-
Notifications
You must be signed in to change notification settings - Fork 712
New WithOpenApi() methods breaks ASP.NET API Versioning #920
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
It's definitely not "too early". This is exactly the type of feedback I'm looking for and is why there is a preview. Honestly, this is the ammunition I'm looking for. The ASP.NET team has been trying to say the API Explorer isn't important anymore and everything will focus directly on OpenAPI 😞 . API Versioning doesn't directly care about OpenAPI or use any of its libraries. It provides exploration extensions that allow it to be used in OpenAPI and many other places. This is happening for two reasons:
I'd also be curious what else you want or need from |
I think my needs aren't particularly complex (though, sadly, I don't have a real world scenario to use at this moment, so I'm talking from memory about past projects). We heavily relied on OpenAPI for API reviews (contract first), so we provided details about as many things as possible (i.e. summaries, descriptions samples and so on of operations, parameters and models). In terms of versioning, we used the URL segment approach, and having the ability to switch between versions with that top right dropdown in the UI is nice. |
Just a quick update. I did find a way to retain the name specified in As for the issue with deprecation, I don't think there is good answer beyond what has already been shared as a workaround. The OpenAPI extensions are paired to an endpoint |
Great to hear 🙂.
If I'm honest, the deprecation bits wasn't something I had considered before, just tried them because I noticed the library supported them (and seems useful). The scenario I reported is possibly not so common, so I guess the workaround is fine for folks (at least it is for me). |
The name issue is fixed in |
Is there an existing issue for this?
Describe the bug
When using the new
WithOpenApi()
methods, from theMicrosoft.AspNetCore.OpenApi
package, ASP.NET API Versioning seems to be affected and some features misbehave.A couple of examples I've noticed:
MapApiGroup
isn't used to group the endpoints in the Swagger UIA couple of visual examples:
Expected Behavior
ASP.NET API Versioning features working the same, regardless of
WithOpenApi
usage.Steps To Reproduce
To reproduce, all I did was use the
MinimalOpenApiExample
available in the examples, then:Microsoft.AspNetCore.OpenApi
package:WithOpenApi
in one of the endpoints:Complete repro example: https://github.com/joaofbantunes/AspNetApiVersioningWithOpenApiRepro
Exceptions (if any)
No response
.NET Version
7.0.100
Anything else?
Apologies if it's "too soon", as I'm reporting this while testing with ASP.NET API Versioning 7.0.0-preview.2, and maybe you're aware of the issue just haven't got to it yet. Just in case, as I was testing, thought of reporting.
Also, not sure if this is something fixable here, or misbehavior of
Microsoft.AspNetCore.OpenApi
?The text was updated successfully, but these errors were encountered: