-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When configuring our .NET 10 project to generate OpenAPI documents of version 3.0, the OpenAPI schema for decimal properties seems to be incorrect:
"temperatureC": {
"pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
"format": "double"
}
We use version 3.0 as we later on want to import these OpenAPI documents in Azure API Management which doesn't support the newer OpenAPI versions.
However, Azure API Management ignores this decimal field because (I think) according to the OpenAPI version 3.0 specification:
- The schema is missing the required
type: "number"property - The
patternproperty is only valid fortype: "string", not numeric types
Previously with the Swashbuckle library, the property was outputted as
"temperatureC": {
"type": "number",
"format": "double"
}
which was imported correctly in Azure API Management.
Expected Behavior
Use the correct OpenAPI 3.0 specification for decimal properties if the project is configured as such.
"temperatureC": {
"type": "number",
"format": "double"
}
Steps To Reproduce
Exceptions (if any)
No response
.NET Version
10.0.100
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi