zaach / jsonlint

A JSON parser and validator with a CLI.
http://zaach.github.com/jsonlint/
1.93k stars 417 forks source link

Validation outcome? #108

Open pkaramol opened 6 years ago

pkaramol commented 6 years ago

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

jsonlint test.json --validate logstash/files/squid_schema.json

However, I only get the file test.json in my stdout.

How am I informed if the validation against the schema failed or not?

Using

$ jsonlint -v
1.6.3

on Ubuntu 16.04.04

mainrs commented 6 years ago

If the schema failed, it should print out the errors:

❯ jsonlint schemas/firebase.schema.json -V __tests__/failed.schema.json 
Validation Errors:

Instance is not a required type
uri: https://angular.io/schemas/cli-1/schema#/required
schemaUri: http://json-schema.org/draft-03/hyper-schema#/properties/required
attribute: type
details: ["boolean"]

The exit code is non null too.