Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds option to maintain different media types of one one response type #317

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

baflo
Copy link
Contributor

@baflo baflo commented Jan 19, 2024

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

@baflo
Copy link
Contributor Author

baflo commented Jan 24, 2024

@luisfpg Do you mind reviewing this PR?

1 similar comment
@baflo
Copy link
Contributor Author

baflo commented Jun 21, 2024

@luisfpg Do you mind reviewing this PR?

@luisfpg
Copy link
Contributor

luisfpg commented Jun 21, 2024

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.

@baflo
Copy link
Contributor Author

baflo commented Jun 23, 2024

Thank you for the update :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants