Closed admir86 closed 6 years ago
@admir86 Thank you for your PR 👍 I'll try to review it soon.
I noticed there are some code format changes which shouldn't be included in PR.
@vmasek ok thx. the code format changes are probably from vs code (format on save) sorry for that.
By the way, the tests are broken since the swagger file validation step.
Preferably I would also pick tags for splitting API client to multiple services as it is much more explicit.
@admir86 so with this PR you will be able to create (generate) one API service at the time (based on the tag name), I think it would be best to extend it so you will be able to specify which tags should be generated as a list.
splitPathTags
(feel free to come up with something better :smile: )One more thing is, the skip module option is because of services being part of the module and you want to provide them separately in modules where you use them?
@vmasek thx for your feedback.
I think it would be best to extend it so you will be able to specify which tags should be generated as a list.
If there are more than one tag passed to the generator, would you create for each tag/api a separate file/service or should the behavior be same, like without this splitPathTags
option (all apis in same file)
Parameter name 'apiName' should be changed to something more semantically correct, for example, splitPathTags (feel free to come up with something better 😄 )
I was inspired by the selective generation option from swagger-codegen but the name splitPathTags
is ok :)
One more thing is, the skip module option is because of services being part of the module and you want to provide them separately in modules where you use them?
yes that's correct
@admir86 It would create separate service for each tag.
Also, it could support generating all tag+service options, if some special value is used (all
) or if the flag is used with no parameter?
ok I'll try :) maybe tomorrow or next days...
now better? feel free to make some code refactoring :)
@vmasek thx!
Thank you for your collaboration :+1: I was planning to as such a functionality but didn't get to it in time :smile:
Now tests are the priority, later I will probably be extending it more.
added new options.
-n, --apiName
possibility to use only a subset of the swagger definitions as input for the generator. For this I use the operationId field to filter the definitions (filter by operationId works for me but perhaps is better to filter by tag?) with this options only needed models will be generated and the angular service gets the name of the apiName parameter.example:
calling api-client-generator with -n DummySelector will fetch all paths where operationId starts with DummySelector
-m, --skipModule
if you don't need the module, you can use this option to skip creating the index file with the module export