Replies: 1 comment
-
@Dev-Drew Hi,
The https://json-schema.org/draft/2020-12/json-schema-validation#name-exclusivemaximum
The OpenAPI 3.1 and above adheres to the Json Schema specification (specifically 2020-12) for type representation. The https://json-schema.org/understanding-json-schema/reference/numeric#range
Historically, OpenAPI has had various interpretations of the Json Schema specification and it's possible the authors of The correct type is This would be a good thing to submit to the nestjs/swagger project as an issue. Feel free to link back to here for relevant links and information. Hope this helps |
Beta Was this translation helpful? Give feedback.
-
I'm defining a TypeBox schema then using it generate documentation with nestjs/swagger.
@sinclair/typebox defines Number with exclusiveMaximum and exclusiveMinimum as type number
nestjs/swagger is based on open-api-spec and has a SchemaObject which contains exclusiveMaximum and exclusiveMinimum as type boolean.
This of course causes an error, consider the following
Which results in
Just curious what the reason is for making
exclusiveMaximum
/exclusiveMinimum
a number and how others may have solved.Beta Was this translation helpful? Give feedback.
All reactions