Working with stdin #641
Unanswered
DavidBiesack
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
Hey @DavidBiesack , we actually have this open: #614 addressing exactly this. Hopefully we manage to merge it soon! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Does (should)
validatework with stdin for either the schema or instance paths on the command line, or does it require an actual file with a file name and extension?(It is common for CLI tools, at least in Unix/Linux systems, to accept the file name
-to mean "stdin")I tried
$ my-long-pipline-yielding-a-JSON-schema | jsonschema validate - invalid.yaml error: No such file or directory at file path /private/tmp/-This works on shells (like bash) that support <(pipeline) to yield named pipes but it is more cumbersome to use:
jsonschema validate <(my-long-pipline-yielding-a-JSON-schema) valid.yaml(in my case, bash on Mac OS, bash yields a filename such as
/dev/fd/63)However, even that notation does not work with a pipeline that yields YAML instead of JSON
jsonschema validate <(my-long-pipline-yielding-a-JSON-schema-as-YAML) valid.yaml unexpected error: Expected YAML document start Please report it at https://github.com/sourcemeta/jsonschemaThat is, `jsonschema' appears to assume JSON if the "file name" ( a named pipe in this case) does not end with .yaml)
Beta Was this translation helpful? Give feedback.
All reactions