ng-openapi-gen
ng-openapi-gen copied to clipboard
Adds option to maintain different media types of one one response type
I started to use your project to generate my Angular client, but soon stumbled on the problem described in #183, so I offer an opt-in solution here.
I added the option keepFullResponseMediaType, where one can choose which media type should be shortened to $Json or which should be kept in whole.
Specifically, when true, the expected response type in the request method names are not abbreviated and all response variants are kept.
When array is given, mediaType is expected to be a RegExp string matching the response media type. The first match in the array
will decide whether or how to shorten the media type. If no mediaType is given, it will always match.
| option value | media type | variant method name |
|---|---|---|
| short | application/x-spring-data-compact+json | getEntities$Json |
| tail | application/x-spring-data-compact+json | getEntities$XSpringDataCompactJson |
| full | application/x-spring-data-compact+json | getEntities$ApplicationXSpringDataCompactJson |
@luisfpg Do you mind reviewing this PR?
@luisfpg Do you mind reviewing this PR?
I'm sorry, but I'm having basically no time to work on this project. I'll try to give it a go in the next few days, but I can't promise anything.
Thank you for the update :)