json-spec icon indicating copy to clipboard operation
json-spec copied to clipboard

Unable to validate via cli

Open pkaramol opened this issue 7 years ago • 1 comments

I am trying to validate a file against a schema as follows:

$ jsonschema -i /path/to/schema.json test.json

It fails with this message:

usage: jsonschema [-h] [-i INSTANCES] [-F ERROR_FORMAT] [-V VALIDATOR] schema
jsonschema: error: argument -i/--instance: invalid _json_file value: '/path/to/schema.json'

However, when validating the schema itself in an online json validator, e.g. this one, it succeeds.

pkaramol avatar Mar 28 '18 11:03 pkaramol

Turns out it had to do with some trailing commas (',') in some entries.

However, even after fixing this, I get no output despite the fact that there are fields which are present in schema.json and missing in test.json.

pkaramol avatar Mar 28 '18 12:03 pkaramol