Skip to content
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

Fail to build open-api spec, because of a $ref circle #320

Closed
DoctorFuchs opened this issue Aug 5, 2022 · 2 comments
Closed

Fail to build open-api spec, because of a $ref circle #320

DoctorFuchs opened this issue Aug 5, 2022 · 2 comments

Comments

@DoctorFuchs
Copy link
Contributor

DoctorFuchs commented Aug 5, 2022

In commons.yml the $ref points to combined.yml, which points back to a parent node of the first $ref.

For example, when i run
swagger-cli bundle ./api/src/swagger/swagger.yml -r -o spec.json
i get the following output:
Circular $ref pointer found at /home/doctorfuchs/api/src/swagger/schemas/common.yml#/option-model/oneOf/2/properties/items/items

Edit: BTW it worked a few weeks ago...

@SleeplessOne1917
Copy link
Contributor

What package are you using for swagger cli? I ran into circular $ref issues with swagger-cli, but it worked with @apidevtools/swagger-cli. You may need to get the latest changes and run npm install to get that npm package. Also, the repo comes with a bundle-swagger command in package.json, so you could try using that.

@DoctorFuchs
Copy link
Contributor Author

When you use this command, you run quickly in another problem:
swagger-cli#75
Because i want to handle the swagger.yml / swagger.json automatically, errors like this shouldn't happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants