-
Notifications
You must be signed in to change notification settings - Fork 712
SwaggerODataSample throws Exception when accessing V1, V2 and V3 #729
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
Hi, I encountered the same problem. As a workaround, downgrading Swashbuckle.AspNetCore Nuget package to 5.6.3 helped. |
I found the solution but couldn't find the cause.
|
I've discovered that this specific issue is a bug in Swashbuckle. Updating to the latest release should fix this. You might, however, run into other issues related to route template generation (not model generation). Peek at the updated sample in this branch. That may address them until the next patch is released. |
Hi,
I'm currently on v5.0.0 and can't access the swagger docs for every version greater than 0.9.
Here is what the log is telling me:
Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Failed to generate Operation for action - Microsoft.Examples.V1.OrdersController.Post (SwaggerODataSample). See inner exception ---> Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Failed to generate schema for type - Microsoft.Examples.Models.Order. See inner exception ---> System.InvalidOperationException: Can't use schemaId "$Order" for type "$Microsoft.Examples.Models.Order". The same schemaId is already used for type "$Microsoft.Examples.Models.Order" at Swashbuckle.AspNetCore.SwaggerGen.SchemaRepository.RegisterType(Type type, String schemaId)
The text was updated successfully, but these errors were encountered: