jsonsystems / json-schema

JSONSchema.Net Public Repository
Apache License 2.0
663 stars 64 forks source link

ExclusiveMinimum error message shows inadecuate text #123

Closed PaolaFalcon closed 2 years ago

PaolaFalcon commented 2 years ago

I'm using JsonSchema.NET version 2.0.0 on a C# project with framework net6.0

When testing the validations, the message shown about a negative number or 0 with the specified schema of exclusiveMinimum 0 is: -20 is not less than 0 0 is not less than 0

I think the message should be: -20 is less than or equals to 0 0 is less than or equals to 0

The schema I'm using is this:

{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "type": "object",
  "properties": {
    "minimum_buy_amount": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "minimum_sell_amount": {
      "type": "integer",
      "exclusiveMinimum": 0
    }
  },
  "required": [
    "minimum_buy_amount",
    "minimum_sell_amount"
  ]
}

The json I'm trying to validate is this:

{
  "minimum_buy_amount": -20,
  "minimum_sell_amount": 0
}

I can't find any other issues related to this message, and I don't know if there's any more like this one.

jackwootton commented 2 years ago

@PaolaFalcon www.jsonschema.net does not perform validation. It sounds like you're referring to https://json-everything.net/json-schema/