Open MatthiasMargot opened 3 years ago
I vote for the 3rd option for the input part.
Is not clear what are you referring to about the output in the 3rd bullet point.
So, for option 3 here, I mean that it would be possible to decide whether the input is yarn or json based on the file extension e.g.:
typegen input.json output.ts
vs
typegen input output
Here in the 2nd example command that would not be possible since the two path arguments are provided without extensions so the 2nd case here would result in an un-supported usage of the API. I think the 2nd case should work so I'm not too much in favor of option 3 but we'll have to see what's possible.
There's a dependency specified for this project called "swagger-parser" that's currently not used. It was introduced to support yaml as the input format for source-files that typegen should parse. Currently typegen only supports json format.
Support for yaml should be added, some options for API implementation:
json