Skip to content

Feature Request: Support annotations (for validation and spec generation) for exclusiveMinimum/exclusiveMaximum #1842

@jefflembeck

Description

@jefflembeck

minimum and maximum give us the minimum or maximum value that a number can be (val >= 2 for example), but that's not the same as exclusiveMinimum or exclusiveMaximum which give us the the min or max it can get close to (val > 2 instead) — this is important and useful for floats especially.

Given that in 2.0 and 3.0, exclusiveMinimum/exclusiveMaximum output is a boolean and in 3.1 it's the number itself, I think it would be nice to have a coherent and consistent way to handle this.

My best suggestion is (example) @exclusiveMinimum 3 — this will set our output to be exclusiveMinimum: 3 in 3.1, but exclusiveMinimum: true; minimum: 3 in 2.0 and 3.0

If you use minimum and exclusiveMinimum at the same time in 3.1, it should be fine (but the more stricter of the two will win out).

If you use minimum and exclusiveMinimum at the same time in 2.0 and 3.0, let's call that a compiler error.

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