Skip to content

Set $exclusiveMinimum and $exclusiveMaximum default false #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: xs-nullable-types
Choose a base branch
from

Conversation

nohponex
Copy link
Member

From draft v4

5.1.2.  maximum and exclusiveMaximum

5.1.2.1.  Valid values

   The value of "maximum" MUST be a JSON number.  The value of
   "exclusiveMaximum" MUST be a boolean.

   If "exclusiveMaximum" is present, "maximum" MUST also be present.

5.1.2.2.  Conditions for successful validation

   Successful validation depends on the presence and value of
   "exclusiveMaximum":

      if "exclusiveMaximum" is not present, or has boolean value false,
      then the instance is valid if it is lower than, or equal to, the
      value of "maximum";

      if "exclusiveMaximum" has boolean value true, the instance is
      valid if it is strictly lower than the value of "maximum".

5.1.2.3.  Default value

   "exclusiveMaximum", if absent, may be considered as being present
   with boolean value false.

Though in draft v7 exclusiveMaximum is defined as number instead of boolean
See https://json-schema.org/understanding-json-schema/reference/numeric.html#range

Maybe we should support both?

@nohponex nohponex requested review from alkallio and akalineskou May 10, 2019 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant