Skip to content

NumberConstraint allows 0.00 for an exclusive minimum of 0 #199

Closed
@wpillar

Description

@wpillar

When validating this:

{
  "amount": 0.00
}

Against this:

{
  "properties": {
    "amount": {
      "type": "number",
      "minimum": 0,
      "exclusiveMinimum": true
    }
  }
}

It passes, when it should fail according to this json schema linter:

image

http://jsonschemalint.com/draft4/

This is because of the strict equality check here: https://github.com/justinrainbow/json-schema/blob/master/src/JsonSchema/Constraints/NumberConstraint.php#L28

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions