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

Swagger APIView fails with stack overflow on circular reference #4693

Closed
chrissmiller opened this issue Nov 14, 2022 · 4 comments
Closed

Swagger APIView fails with stack overflow on circular reference #4693

chrissmiller opened this issue Nov 14, 2022 · 4 comments
Assignees
Labels
APIView Central-EngSys This issue is owned by the Engineering System team.

Comments

@chrissmiller
Copy link

The API view tool stack overflows when presented with a circular reference in a swagger file. In our case, the CloudErrorBody in the spec referenced below contains an array of CloudErrorBody objects within its details property. To our knowledge, this is allowed and is a standard way to return CloudErrors. The APIView tool should not crash on this.

Example spec that causes the issue:
https://github.com/Azure/azure-rest-api-specs/blob/f4d938bc278b402ac81bc9bc941642d8ed3c51c0/specification/devcenter/data-plane/Microsoft.DevCenter/preview/2022-11-11-preview/devcenter.json

Example check run:
https://github.com/Azure/azure-rest-api-specs/pull/21454/checks?check_run_id=9419920269

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Nov 14, 2022
@maririos maririos added APIView Central-EngSys This issue is owned by the Engineering System team. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Nov 14, 2022
@azure-sdk azure-sdk moved this to 🤔Triage in Azure SDK EngSys 🚢🎉 Nov 14, 2022
@azure-sdk azure-sdk moved this to 🆕 New in ApiView Nov 14, 2022
@maririos
Copy link
Member

@ruowan could you please take a look?

@maririos maririos moved this from 🆕 New to 📋 Backlog in ApiView Nov 14, 2022
@maririos maririos moved this from 🤔Triage to 📋Backlog in Azure SDK EngSys 🚢🎉 Nov 14, 2022
@ruowan
Copy link
Member

ruowan commented Nov 15, 2022

Sure. I will take a look.

@ruowan
Copy link
Member

ruowan commented Nov 17, 2022

We already have circular reference handle but not support cross file reference. I did circular reference support for cross file reference. I have already created a PR to fix it. Here is example I test it with new version of swagger apiParser. https://apiviewstaging.azurewebsites.net/Assemblies/Review/eb2bc3f8c130420da2c89046b499f7e5. Looks good.

@maririos maririos moved this from 📋 Backlog to 🏗 In progress in ApiView Nov 21, 2022
@ruowan
Copy link
Member

ruowan commented Nov 22, 2022

Close this issues. Fixed.

@ruowan ruowan closed this as completed Nov 22, 2022
Repository owner moved this from 📋Backlog to 🎊Closed in Azure SDK EngSys 🚢🎉 Nov 22, 2022
Repository owner moved this from 🏗 In progress to ✅ Done in ApiView Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIView Central-EngSys This issue is owned by the Engineering System team.
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants