json-schema-to-typescript icon indicating copy to clipboard operation
json-schema-to-typescript copied to clipboard

feat: [#631] implemented refOptions CLI argument

Open ndopj opened this issue 1 year ago • 1 comments

resolves: https://github.com/bcherny/json-schema-to-typescript/issues/631

Current changes accept $refOptions argument as JSON string from command line.

Those options are then being merged with default value for $refOptions. Even if current default value {} would be changed in the future, fields from command line argument --refOptions won't influence "not overridden" $refOption fields.

Command line argument --refOptions cannot use 1:1 naming with Options interface field $refOptions because it contains $ character which might cause issues (on some Shells), if the command line arguments are not being enclosed as string ("").

Still need to figure out if its possible to create any meaningful tests for this !! Any help or feedback appreciated.

ndopj avatar Sep 11 '24 00:09 ndopj

@bcherny Could I kindly ask for a review ? Don't know anybody amongst contributors so tagging you as an active one. I hope its not rude to you, in that case I am sorry :no_mouth:

Also if test should be included for this CLI option - I am not sure whether this would fit testCLI.ts structure. If I understand it correctly, tests are implemented via snapshots meaning it's asserted that output of each tested operation is same ? However, in such case, it would not be possible to include scenario described in the linked issue. I am correct ?

ndopj avatar Sep 11 '24 06:09 ndopj