Skip to content

Commit

Permalink
Don't encode content types
Browse files Browse the repository at this point in the history
Fixes #274
  • Loading branch information
Luis Fernando Planella Gonzalez committed Oct 9, 2023
1 parent c48949b commit d089b27
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/fn.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function {{importName}}(http: HttpClient, rootUrl: string, params{{^opera
}

return http.request(
rb.build({ responseType: '{{responseType}}', accept: '{{accept}}', context })
rb.build({ responseType: '{{{responseType}}}', accept: '{{{accept}}}', context })
).pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
Expand Down
2 changes: 1 addition & 1 deletion test/all-operations.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
"RefResp": {
"description": "I am a response",
"content": {
"application/json": {
"application/vnd.my-custom-type+json;version=2": {
"schema": {
"type": "object"
}
Expand Down
2 changes: 1 addition & 1 deletion test/all-operations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ describe('Generation tests using all-operations.json', () => {
expect(operation.allResponses.length).toBe(1);
const success = operation.successResponse;
if (success) {
const json = success.content.find(c => c.mediaType === 'application/json');
const json = success.content.find(c => c.mediaType === 'application/vnd.my-custom-type+json;version=2');
expect(json).toBeDefined();
const resp200 = operation.allResponses.find(r => r.statusCode === '200');
expect(resp200).toBe(success);
Expand Down

0 comments on commit d089b27

Please sign in to comment.