Closed roalonso closed 1 year ago
Hi @roalonso,
According to the spec of v.3.0.2 it uses JSON Schema Draft-00 and it doesn't define exlusiveMinimum
/exclusiveMaximum
at all unless I'm missing something. Could you specify how did you find it should be a number?
OpenAPI 3.1.x is fully aligned with JSON Schema draft 2020-12 and has changed the behavior of exclusiveMinimum
and exclusiveMaximum
keywords.
https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0
You are using 3.0.2 and it's base schema is aligned with JSON Schema draft 04 where these two keywords accepted a boolean value, not a number.
https://github.com/OAI/OpenAPI-Specification/blob/main/schemas/v3.0/schema.json#L349 https://github.com/OAI/OpenAPI-Specification/blob/main/schemas/v3.0/schema.json#L356
I see, the extension is behaving as expected then.
What happened?
When using
exclusiveMinimum
andexclusiveMaximum
properties with OAS v3, the validator marks its usage as an error, saying its value should be a boolean. However, since OAS v3 this field now holds the actual (exclusive) minimum/maximum value, and is no longer a boolean.What should have happened instead?
An integer or float should be accepted as the value for
exclusiveMinimum
/exclusiveMaximum
. A boolean should no longer be accepted when using OAS v3.x.x.Minimal reproducible OpenAPI snippet
Screenshots
Additional context
Using OAS 3.0.2.