Open liquidaty opened 3 years ago
Thanks for these suggestions but I'm not sure whether I'll have time to implement that.
OK thanks for the response. We will fork it ourselves and start a separate repo.
Before doing so, just wanted to confirm: you did see that all the code needed for the requested change is already there, and all that is needed to make these changes is to copy/paste those two snippets, and entirely replace the target files (probably all of 3 minutes)? Just don't want to duplicate a repo if not needed to do so
@liquidaty
Maybe it's easy to integrate this code but it's needed to check whether it works.
Generally, it's simpler if you open a PR. I don't promise to merge it as I'll need to check it but it'll be simpler for me than to copy-paste your code.
@liquidaty
I see that nobody has voted for resolving this issue with :+1: or :heart:, and there are no comments from people other than you and me.
Neither I need these updates.
Your code contains no tests and no descriptive README update.
Your updates seem to contain much more code than my current business logic (when we count only JS files, excluding tests).
Therefore, I decided to close this issue, without implementing it.
Anyway, thanks for this proposal and your code.
Regarding the output, maybe it would be better if this library supported only stdout so we could write to a file with the >
bash operator.
However, currently, it doesn't seem to be a major problem as you can use cat
e.g. generate-json schema.json output.json && cat output.json
or possibly if you don't want any file created at the end: generate-json schema.json output.json && cat output.json && rm output.json
Btw. If I decided to use your code, I would change some parts like:
const
or let
instead of var
...
) instead of .concat(
if
and else
I agree. CLI usage and a way to provide options would be very useful.
This would be of great interest to my org as well.
@liquidaty @reubano @sectoreleven
Could you check json-schema-faker-cli@5.0.3
?
@liquidaty @reubano @sectoreleven
Could you check
json-schema-faker-cli@5.0.3
?
We've been using the @liquidaty fork successfully, so changing that will be a bit low on our list currently.
I did not see any way to pass command-line options corresponding to the various options offered by the underling json-schema-faker library, so I made some changes for it to do so.
In addition, the CLI does not provide any usage message or user-friendly error messages if, for example, it is run with an insufficient number of arguments.
Lastly, if no output file is specified, it should output to stdout.
Could you please incorporate these changes to address these issues? They are pretty simple, so I didn't bother with a PR. This will allow you to do the following:
The changes were to two files, generate.js and generate-json:
// --- app/generate.js ---
// --- .bin/generate_json