.NET Core 9 Minimal Versioned API w/OpenAPI #1126
-
I've been following the examples outlined here for a .NET Core 9 minimal API with OpenAPI, but I'm running into several issues and wasn't sure if this was a bug or if I'm misunderstanding something. My code:
.csproj
Removing the ConfigureSwaggerOptions and manually defining the two API versions (as outlined in my code above) resolves the exception for IApiVersionDescriptionProvider, but only one version of the API appears in the dropdown of the generated Swagger page and both endpoints show up with both versions of the response schema: I'm not really sure how to set this up so only the defined endpoints of the specified version show up with the correct schemas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Which packages do you have referenced? It sounds like you are missing |
Beta Was this translation helpful? Give feedback.
Unfortunately, I don't have a great story or example for this situation - yet. It's on my list, but I've just been incredibly backed up. The best example and guidance I have at the moment is to follow how the eShop reference application sets things up. It's less than ideal IMHO, but it seems several people have been following that. As soon as I can get something more streamlined, I'll update the examples.