-
-
Notifications
You must be signed in to change notification settings - Fork 528
use the same openapi, json file generate ok, but yaml file generate error #1093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I’ll take a look at this. Thank you for submitting a PR! But I fear that may not fix the underlying issue here, and I’d like to take a different approach. |
The reason for this bug is: |
The core reason is due to changes in the value of currentSchema, |
Thanks for the update. I plan on digging into this more this weekend myself! |
OK I’m digging into this for the first time, and I think I’m missing something: schema:
type: array
items: &ref_0
$ref: '#/components/schemas/ActivityBase' How is this valid YAML? properties:
activityBases:
description: activityBases
type: array
items: *ref_0 How is this a valid OpenAPI schema? When I try and validate this schema, I get:
Could you try updating your example with a YAML schema that:
|
when i use, noRefs true, it will not use & Node Anchors generate yaml file import { dump } from 'js-yaml';
dump({obj data}),{noRefs: true}); Now I have temporarily added this configuration to the generated yaml file. |
Excuse me, how is the progress in handling this issue? Do you have a better plan? |
Hello! Yes I’ve pinpointed the issue. And I can fix it easily. Will comment thoughts on the PR. |
This has been fixed in |
Description
the same openapi:
when use openapi.yaml have a generate bug.
when use openapi.json no generate bug.
use openapi.yaml generate error data:
openapi-typescript
6.2.4
16.14.0
macOS 13, Windows 10, etc.
Reproduction
How can this be reproduced / when did the error occur?
openapi.json
openapi.yaml
Expected result
Checklist
The text was updated successfully, but these errors were encountered: