Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When using two classes as result from minimal api, that are using same class, openapi definition contains two copies of the object for example: WeatherForecast and WeatherForecast2.
"components": {
"schemas": {
"WeatherForecast": {
"required": [
"date",
"temperatureC",
"summary"
],
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date"
},
"temperatureC": {
"type": "integer",
"format": "int32"
},
"summary": {
"type": "string",
"nullable": true
},
"temperatureF": {
"type": "integer",
"format": "int32"
}
},
"nullable": true
},
"WeatherForecast2": {
"required": [
"date",
"temperatureC",
"summary"
],
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date"
},
"temperatureC": {
"type": "integer",
"format": "int32"
},
"summary": {
"type": "string",
"nullable": true
},
"temperatureF": {
"type": "integer",
"format": "int32"
}
}
},
I created reproduction sample code.
Expected Behavior
It should generated schema with one WeatherForecast.
Steps To Reproduce
Run repo project, open scalar and click Download OpenAPI Document
Exceptions (if any)
No response
.NET Version
9.0.5
Anything else?
No response