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

How to use correctly customizedResponseType property in config? #328

Open
TE-GVGroup opened this issue Sep 6, 2024 · 3 comments
Open

How to use correctly customizedResponseType property in config? #328

TE-GVGroup opened this issue Sep 6, 2024 · 3 comments
Labels
needs info More information is needed

Comments

@TE-GVGroup
Copy link

ng-openapi-gen generates methods which use responseType 'blob' like that:

return http.request( rb.build({ responseType: 'blob', accept: '*/*', context }) ).pipe( filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse), map((r: HttpResponse<any>) => { return r as StrictHttpResponse<UserInfoDto>; }) ); }

I need to change default responseType from blob to json and have this piece of code in config, but this is not working:
"customizedResponseType": { ".*": { "toUse": "json" } }

how to configure correctly customizedResponseType propery?

@luisfpg
Copy link
Contributor

luisfpg commented Sep 6, 2024

Can you share your specification yaml / json?
The customizedResponseType was added via a PR, so I myself have never used it, but it doesn't support patterns, but matches for exact paths.

@luisfpg luisfpg added help wanted Extra attention is needed needs info More information is needed and removed help wanted Extra attention is needed labels Sep 6, 2024
@TE-GVGroup
Copy link
Author

Can you share your specification yaml / json? The customizedResponseType was added via a PR, so I myself have never used it, but it doesn't support patterns, but matches for exact paths.

I think the solution will be custom handlebars if I can use it with ng-openapi-gen command. There is no specific information about which responseType has each endpoint in my yaml/json.

Thanks for your attention.

@luisfpg
Copy link
Contributor

luisfpg commented Nov 19, 2024

It seems that you have some content type in responses that isn't being recognized as JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info More information is needed
Projects
None yet
Development

No branches or pull requests

2 participants