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

Custom Model swagger specs expose too many not needed #1952

Open
1 task done
TheGreatRefrigerator opened this issue Jan 21, 2025 · 0 comments
Open
1 task done

Custom Model swagger specs expose too many not needed #1952

TheGreatRefrigerator opened this issue Jan 21, 2025 · 0 comments
Labels
bug 🐞 Erroneous behavior of the backend

Comments

@TheGreatRefrigerator
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

Adjusting the example in 2c46c1f did not fix the underlying issue with what object schemas are generated.
As the swagger-core uses the existing classes to generate the schemas used in the OpenApi specs, it will traverse all class dependencies down and resolve everything it can.
Image
This leads to recursive dependencies, which break the API playground on staging. (It resolves all linked schematics and currently can't handle recursive schemas in the preprocessing step.)
https://staging.openrouteservice.org/dev/#/api-docs

Proposed solution

See overriding models for how swagger-core operates and what can be done about adjusting the generated model.
Also see https://github.com/GIScience/openrouteservice/blob/main/ors-api/src/main/java/org/heigit/ors/api/responses/snapping/geojson/

The GeoJSONFeature.java works properly. Maybe something can be borrowed from there as well.

Additional context

No response

Forum Topic Link

No response

@TheGreatRefrigerator TheGreatRefrigerator added the bug 🐞 Erroneous behavior of the backend label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Erroneous behavior of the backend
Projects
None yet
Development

No branches or pull requests

1 participant