Skip to content

Appropriate use of exclusiveMinimum and exclusiveMaximum #65

Open
@nasajoey

Description

@nasajoey

exclusiveMinimum: true

OpenAPI 3.0.3 (and I think 3.0.2) defer the definition of the exclusiveMaximum and exclusiveMinimum fields to the JSON schema specification. There (https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.2) the definition is:

6.2.3. exclusiveMaximum
The value of "exclusiveMaximum" MUST be a number, representing an exclusive upper limit for a numeric instance.

If the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) "exclusiveMaximum".

The current astm-utm yaml uses booleans. I think this is a holdover from OAS 2.0 (https://swagger.io/specification/v2/) that defined them as such.

This issue/task would be to disposition all of the exclusiveMinimum and exclusiveMaximum fields. This may mean removing them, or updating them with a numeric value per JSON Schema specification. Note that if it is the latter, there may be a need to remove or modify any adjacent "minimum"/"maximum" fields.

This change is important for tooling related to code generation and validation of the schema. For example, trying to re-use or reference these schemas from other schemas causes errors due to lack of JSON Schema adherence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions