CMSgov / price-transparency-guide-validator

Validation tool to check output files required by the price-transparency-guide
Apache License 2.0
29 stars 13 forks source link

Command line requirements #13

Closed shaselton-usds closed 2 years ago

shaselton-usds commented 2 years ago

placeholder

./validator-tool schema.json jsonfile.json

Possible Options

-o : "location of file output results"
-m : "setting the allowed amount of RAM (member) to be used for streaming."
-v : "the schema version in which the jsonfile.json is being validated against."
awatson1978 commented 2 years ago

This is what we currently have. Been cleaning the help commands up, and have it so that it displays automatically on command failure.

% validator-tool
Usage: validator-tool <cmd> [args]

Commands:
  validator-tool readfile        Read a file
  validator-tool validate        Validate JSON file.
  validator-tool generate        Generate sample NDJSON file.
  validator-tool stream          Stream file and validate each line (NDJSON).
  validator-tool compress        Compress the JSON record.
  validator-tool pack            Pack the JSON record.
  validator-tool minify          Minify the JSON record with a mapping file.
  validator-tool walk            Walk a large JSON record via streaming.
  validator-tool walk-and-match  Walk a large JSON record and validate.
  validator-tool extract         Extract matching schemas from a large JSON file.

Options:
      --help           Show help  [boolean]
      --version        Show version number  [boolean]
      --file           Path to file.
      --schema         Path to a schema file (in JsonSchema format)
  -s, --save           Location to save the output to
  -v, --verbose        Verbose mode
  -d, --debug          Include debugging info
  -t, --trace          Include trace info
  -m, --memory         Amount of memory (RAM) to use.
      --fhir           Specify to output in FHIR format.
      --resource-type  Define a default FHIR resource type for extraction.

Examples:
  validator-tool readfile ../data-files/allowed-amounts.json
  validator-tool validate ../data-files/allowed-amounts-borked.json --schema ../schemas/allowed-amounts.json
  validator-tool generate ../output/allowed-amounts.ndjson --lines 100
  validator-tool walk --file ../data/in-network-rates-fee-for-service-sample.json
  validator-tool walk-and-match ../data-files/in-network-rates-fee-for-service-sample.json --schema ../schemas/negotiated-rate.json
  validator-tool extract --file ../data-files/in-network-rates-fee-for-service-sample.json --schema ../schemas/negotiated-rate.json --save ../output/network-rates.ndjson
  validator-tool extract --file ../data-files/in-network-rates-fee-for-service-sample.json --schema ../schemas/negotiated-rate.json --save ../output/network-rates.ndjson --fhir --resource-type "PricingTier"

Not enough non-option arguments: got 0, need at least 1