jsonschema2pojo icon indicating copy to clipboard operation
jsonschema2pojo copied to clipboard

Support using '-' as CLI argument to read from stdin

Open maxandersen opened this issue 3 years ago • 3 comments

idea I had was to enable using - as reading from standard input so you can do something like:

curl https://api.github.com/users/maxandersen | jbang --debug org.jsonschema2pojo:jsonschema2pojo-cli:1.1.3-SNAPSHOT --source - --target out -T json

would that be interesting ? (if yes I'll investigate adding tests for it)

things I noticed doing this that i'm not sure is expected or bugs:

when treating input as schema the same url is requested multiple times in ContentResolver requiring me to add a cache for standard input...maybe should instead do it generically instead of reading url multiple times?

when treating input as json then content resolvers are NOT used but instead read directly so had to add - handling of urls redundantly.

wdyt ?

maxandersen avatar May 15 '22 22:05 maxandersen

Anyone with a comment ?

maxandersen avatar May 20 '22 05:05 maxandersen

This is a nice little addition max, thanks for submitting.

joelittlejohn avatar May 31 '22 09:05 joelittlejohn

It's been a while since I replied and updated based on comments.

Any chance or merging this?

maxandersen avatar Dec 25 '22 18:12 maxandersen