datacontract / datacontract-cli

CLI to manage your datacontract.yaml files
https://cli.datacontract.com
Other
444 stars 86 forks source link

JSON Schema output on stdout produces invalid JSON #459

Closed hqm42 closed 3 hours ago

hqm42 commented 3 hours ago

datacontract export --format jsonschema ... produced invalid json when it contains long strings (comments for example). Long strings get word wrapped at 80 characters. This prevents the output of the command to be used in other commands expecting json:

check-jsonschema --schemafile <(datacontract datacontract export --format jsonschema my_datacontract) my_data.json

This can be easily tested with jq for example:

datacontract datacontract export --format jsonschema my_datacontract | jq .
jochenchrist commented 3 hours ago

This happens when you run the application in docker. The number of columns is limited to 80.

You can use the --output option to output into a file.

jochenchrist commented 3 hours ago

duplicates https://github.com/datacontract/datacontract-cli/issues/156