-
Notifications
You must be signed in to change notification settings - Fork 704
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
VersionedMetadataController is not in Swagger configuration #893
Comments
The Philosophically, using It is certainly possible to build out documentation for Can you elaborate on the scenario where you'd need or want both OpenAPI and |
Thanks @commonsensesoftware for you quick and complete answer ! The truth is that i'm new to building rest api with odata and before using this package i was simply using I was surprise to discover with this package that they have disappeared and was naively thinking that it was not normal. (i still thing it is, because in my point of view, every endpoints of the api should be "documented" and be known for the dev that would want to use them) Thanks again for your support and amazing answer, i will certainly add the two endpoints with a |
🤔 In years gone by there was no support or integration for the API Explorer, and hence OpenAPI, for OData; I had to create it all. There are still gaps between what OData offers out of the box and the documentation features provided for versioned OData routes; for example, documenting query options. Hopefully, the OData will support all of the necessary documentation needs and supplant the need for me to provide it. I guess if people want it, then they should have it; especially if it is there by default. OData technically has 2 special built-in routes:
There should be a little more to the documentation than just the endpoint URL. If OData provides something by default, then it shouldn't be taken away. It seems there needs to be a configuration option for people to decide if they want one, both, or neither of the endpoints. No one has asked for this in years, so the default would continue to be Adding to list of enhancements. |
Thanks for your answer. And like always i often ask for features than nobody seems to be interested in so don't worry about it :-) |
FYI, services.AddControllers().AddOData();
services.AddApiVersioning()
.AddOData( options => options.AddRouteComponents() )
.AddODataApiExplorer( options.MetadataOptions = ODataMetadataOptions.All ); The
These will be described as an API called |
@commonsensesoftware wahou ! thanks you very much !!! You're the best. |
Is there an existing issue for this?
Describe the bug
I would expect that
VersionedMetadataController
would appear naturally into the swagger's configuration. (likeMetadataController
does if usingMicrosoft.Aspnetcore.Mvc.Versioning
.If you try both of the example app with swagger, the
/api/
and/api/$metadata
don't appear in the documentation.It would seem to me that it would be "normal" to have it automatically, don't you think ?
We could of course add a
IDocumentFilter
to add it manually (and it's working correctly like that) but i feel that most dev would want this ?Thanks for you amazing support !
Expected Behavior
No response
Steps To Reproduce
run
examples/AspNetCore/OData/ODataOpenApiExample
and go to swagger and see that the$metadata
api endpoint is not in the documentation but is working correctly.Exceptions (if any)
No response
.NET Version
6.0.402
Anything else?
ASP.NET Core version: 6.0
Asp.Versioning.OData.ApiExplorer: 6.1.0
Microsoft.AspNetCore.OData: 8.0.10, 8.0.11
Swashbuckle.AspNetCore: 6.3.0, 6.4.0
The text was updated successfully, but these errors were encountered: