leadpony / justify

Justify is a JSON validator based on JSON Schema Specification and Jakarta JSON Processing API (JSON-P).
Apache License 2.0
96 stars 18 forks source link

propertyNames enum problems #38

Closed dmitten-mwb closed 4 years ago

dmitten-mwb commented 4 years ago

First off - thank you for all the work you've already done on this tool! It's extremely useful and a time saver. I'm having an issue currently, though, whenever I try to do the following:

SCHEMA

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "title": "Test Schema",
  "type": "object",
  "properties": {
    "foo": {
      "type": "string"
    },
    "bar": {
      "propertyNames": {
        "enum": [
          "foo",
          "bar",
          "baz"
        ],
        "additionalProperties": {
          "type": "string"
        }
      }
    }
  },
  "required" : [
    "foo"
  ]
}

JSON

{
  "foo" : "test",
  "bar" : {
    "baz" : "howdy"
  }
}

CLI (1.1.0) response

$ ./justify -s schema.json -i schema-test.json 
Validating the schema "schema.json"...
Justified the correctness of the schema "schema.json".
Validating the instance "schema-test.json"...
null

Any thoughts?

leadpony commented 4 years ago

Hello @DMittenMalwareBytes Thank you for reporting the detail. I have reproduced the problem easily and fixed it already. I will release the next 1.2.0 soon which includes this bug fix. Thank you again.

leadpony commented 4 years ago

@DMittenMalwareBytes The bug was fixed in the latest release 2.0.0. Please try the new version.

dmitten-mwb commented 4 years ago

Works perfect! Thanks for the quick turnaround and the great library!