Microsoft.AspNetCore.OpenApi should generate references to shared schemas rather then duplicating them #56264
Closed
1 task done
Labels
feature-openapi
old-area-web-frameworks-do-not-use
*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
This code using
Microsoft.AspNetCore.OpenApi -Version 9.0.0-preview.5.24306.11
generates the following OpenAPI specification
You can see that the
ProblemDetails
details schema as well as theTodo
schema are duplicated for each operation.This results in code generation tools like kiota generating unique models for each operation rather than creating shared ones which causes an explosion of types.
Describe the solution you'd like
This code using
Swashbuckle.AspNetCore -Version 6.6.2
generates the following OpenAPI specification
In this case there is only one definition of the
ProblemDetails
andTodo
schema which is referenced by the operations.Additional context
I wasn't sure whether this was a bug or by design so I've raised as a feature request.
The text was updated successfully, but these errors were encountered: