How to force v1.0 rather than render and accept v1 #1141
Replies: 1 comment
-
|
This is covered by the Custom API Version Format Strings topic. From the example, you have set The minor version is optionally when options.GroupNameFormat = "'v'VV";The |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I borrowed a project from the sample for my own project and its working fine, I'm grateful for the sample projects, they are a great help.
But something I noticed (and the sample behaves the same way) is that swagger generates a UI that shows
v1rather thanv1.0but showsv1.1fine. The service also accepts av1or av1.0.I want to enforce the full version number though, I want Swagger to not render
v1.0asv1and I want the service to reject a segment ofv1and only accept the fullv1.0. Swagger does this in both the dropdown version list and in the rendered URL:So what would need to change in this project to get that behavior? where a
v1.0always appears asv1.0and notv1?https://github.com/dotnet/aspnet-api-versioning/tree/main/examples/AspNetCore/WebApi/OpenApiExample
Beta Was this translation helpful? Give feedback.
All reactions