-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi
Description
Background and Motivation
I've recently been writing up using.NET OpenAPI support combined with openapi-ts:
https://johnnyreilly.com/dotnet-openapi-and-openapi-ts
It's worked out well, but the default choice for numbers, specifically integers seems peculiar:
"temperatureC": {
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": ["integer", "string"],
"format": "int32"
},Here an integer is surfaced as an integer or a string. This seems like a surprising choice. It can be worked around with custom IOpenApiSchemaTransformers:
But it's surprising this is necessary in the first place.
I'm wondering if the default transformers make the most sense? Would they be more useful if they were more along the lines of the customised examples in my post?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi