pboettch / json-schema-validator

JSON schema validator for JSON for Modern C++
Other
470 stars 135 forks source link

"instance not const" on string property #201

Closed Finkman closed 2 years ago

Finkman commented 2 years ago

I have the given schema to validate a json that must have the Type set to RtpcJob.

For this, I am using the following schema:

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "$id": "http://tqswip.com/common/controlling/rtpcjob",
  "type": "object",
  "properties": {
    "Type": {
      "type": "string",
      "const": "RtpcJob",
      "title": "Identifier for loading the job"
    }
  },
  "required": [
    "Type"
  ]
}

I expect the following json to suite the schema. I use https://www.jsonschemavalidator.net/ to verify my schemas while writing. But... the validator throws the following error:

At /Type of "Rtpc" - instance not const

i guess it is a bug, isn't it?

Finkman commented 2 years ago

Sorry, for the noise... I misspelled by own config items.