massdriver-cloud / massdriver-cli

Deprecated. See https://github.com/massdriver-cloud/mass
https://massdriver.cloud
Apache License 2.0
3 stars 2 forks source link

Fix the canonical issue with JSON schema validation and add verbose l… #39

Closed chrisghill closed 2 years ago

chrisghill commented 2 years ago

closes: https://github.com/massdriver-cloud/massdriver/issues/1055

chrisghill commented 2 years ago

Before:

$ mass schema validate -s schema-params.json -d src/dev.params.tfvars.json
{"level":"debug","schemaPath":"schema-params.json","documentPath":"src/dev.params.tfvars.json","time":"2022-06-24T00:43:08-06:00","message":"Validating schema."}
{"level":"error","error":"Reference file://schema-params.json must be canonical","time":"2022-06-24T00:43:08-06:00","message":"Validator failed."}
Error: Reference file://schema-params.json must be canonical
Usage:
  mass schema validate [flags]

Flags:
  -d, --document string   Path to JSON document (default "document.json")
  -h, --help              help for validate
  -s, --schema string     Path to JSON Schema (default "./schema.json")

Global Flags:
  -k, --api-key string   Massdriver API key (can also be set via MASSDRIVER_API_KEY environment variable)

After:

$ mass schema validate -s schema-params.json -d src/dev.params.tfvars.json
Document is valid!