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

feature request: CLI could use file extension to support yaml and json #58

Open toddobryan opened 4 years ago

toddobryan commented 4 years ago

Sometimes, you have a schema in YAML and a doc in JSON or vice versa. Currently, the CLI only supports JSON, I think, but it would be terrific if it could parse YAML or JSON based on the file extension.

leadpony commented 4 years ago

Hello @toddobryan Thank you for nice suggestion. Currently Joy must be configured at compile time for parsing files in YAML. Therefore first we need to modify Joy to accept JsonParser flag for selecting YAML or JSON at runtime.

toolmantim commented 3 years ago

Thanks for the great lib and cli!

I recently ran into this while hoping to use the CLI to validate some YAML: https://gist.github.com/toolmantim/93cd1b877dd2937d51be52d1d132e8ec

It was fairly easy getting it running in Docker like that, but a custom build of the CLI proved to be too hard. A command line flag, or instructions for how to compile a CLI version that supports YAML, would be amazing ❤️