fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #432 from hey-api/fix/interceptors-named-client

fix: use config interceptors passed to constructor when using named c…

authored by

Jordan Shatford and committed by
GitHub
33adebc7 70222a25

+11 -6
+5
.changeset/nasty-spoons-pretend.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + fix: use config interceptors passed to constructor when using named client
+4 -4
packages/openapi-ts/src/templates/client.hbs
··· 37 37 HEADERS: OpenAPI?.HEADERS, 38 38 ENCODE_PATH: OpenAPI?.ENCODE_PATH, 39 39 interceptors: { 40 - response: new Interceptors(), 40 + response: OpenAPI?.interceptors?.response ?? new Interceptors(), 41 41 }, 42 42 } as OpenAPIConfig, 43 43 }, ··· 74 74 HEADERS: config?.HEADERS, 75 75 ENCODE_PATH: config?.ENCODE_PATH, 76 76 interceptors: { 77 - request: new Interceptors(), 78 - response: new Interceptors(), 79 - }, 77 + request: config?.interceptors?.request ?? new Interceptors(), 78 + response: config?.interceptors?.response ?? new Interceptors(), 79 + }, 80 80 }); 81 81 82 82 {{#each services}}
+2 -2
packages/openapi-ts/test/__snapshots__/test/generated/v3_client/ApiClient.ts.snap
··· 71 71 HEADERS: config?.HEADERS, 72 72 ENCODE_PATH: config?.ENCODE_PATH, 73 73 interceptors: { 74 - request: new Interceptors(), 75 - response: new Interceptors(), 74 + request: config?.interceptors?.request ?? new Interceptors(), 75 + response: config?.interceptors?.response ?? new Interceptors(), 76 76 }, 77 77 }); 78 78