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

OpenAPI incorrectly misses some metadata in swagger spec #3376

Closed
8 tasks done
JustArchi opened this issue Jan 18, 2025 · 2 comments
Closed
8 tasks done

OpenAPI incorrectly misses some metadata in swagger spec #3376

JustArchi opened this issue Jan 18, 2025 · 2 comments
Labels
🐛 Bug Issues marked with this label indicate unintended program behaviour that needs correction. ✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developers. ☝️ External Issues marked with this label have external scope and typically depend on third-party projects. ⛔ On hold Issues marked with this label are blocked from being worked on, very often due to third-parties.

Comments

@JustArchi
Copy link
Member

Checklist

ASF version

Latest pre-release

ASF variant

generic (with latest .NET runtime)

Bug description

Since changing swagger generator from Swashbuckle to OpenAPI, we're observing an issue with some references in the swagger generator, in particular, dupes that are sometimes incorrect in their definition.

Notable example:

Image

Expected behavior

Actual behavior

Steps to reproduce

No response

Possible reason/solution

This issue remains open while we're waiting for dotnet/aspnetcore#58968 to ship in .NET 9.0.2+, and confirmation from our side that the issue does not happen anymore.

Can you help us with this bug report?

Yes, I can code the solution myself and send a pull request

Full log.txt recorded during reproducing the problem

-

Global ASF.json config file

BotName.json config of all affected bot instances

Additional info

We'll consider this temporary degradation, since the cost of reverting the OpenAPI generator is much higher than temporary inconvenience from missing x-definition, among other properties.

@JustArchi JustArchi added ☝️ External Issues marked with this label have external scope and typically depend on third-party projects. ⛔ On hold Issues marked with this label are blocked from being worked on, very often due to third-parties. ✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developers. 🐛 Bug Issues marked with this label indicate unintended program behaviour that needs correction. labels Jan 18, 2025
JustArchi added a commit that referenced this issue Jan 20, 2025
@JustArchi JustArchi changed the title ASF V6.1.2.0+ incorrectly misses some metadata in swagger spec OpenAPI incorrectly misses some metadata in swagger spec Jan 20, 2025
@JustArchi
Copy link
Member Author

JustArchi commented Jan 20, 2025

I've decided that reverting back to Swashbuckle is required in regards to breaking changes on ASF-ui side.

For people keen on experimenting, ASF temporarily offers undocumented otherwise --use-openapi cmdline switch, which will force OpenAPI instead of Swashbuckle for swagger generation. It's expected that this option will become default starting from .NET 9.0.2, when the issue mentioned here gets resolved. Until then it's offered for experiments only, as it's known to generate imperfect schema.

If appropriate workaround for dotnet/aspnetcore#58968 is found earlier, and resolving at least the more critical breaking changes, the switch might happen sooner.

@JustArchi
Copy link
Member Author

JustArchi commented Feb 12, 2025

@zerox003 Feel free to review if V6.1.3.1 still works for your use cases. Yes, the schema has changed, but it should no longer change in a way you can't extract the data you need (all enums carry x-definition now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Issues marked with this label indicate unintended program behaviour that needs correction. ✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developers. ☝️ External Issues marked with this label have external scope and typically depend on third-party projects. ⛔ On hold Issues marked with this label are blocked from being worked on, very often due to third-parties.
Projects
None yet
Development

No branches or pull requests

1 participant