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.

fix: regenerate NestJS example client to sync with latest codegen

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+12 -12
+5 -3
examples/openapi-ts-nestjs/src/client/client/client.gen.ts
··· 37 37 ...options, 38 38 fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, 39 39 headers: mergeHeaders(_config.headers, options.headers), 40 - serializedBody: undefined, 40 + serializedBody: undefined as string | undefined, 41 41 }; 42 42 43 43 if (opts.security) { ··· 52 52 } 53 53 54 54 if (opts.body !== undefined && opts.bodySerializer) { 55 - opts.serializedBody = opts.bodySerializer(opts.body); 55 + opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined; 56 56 } 57 57 58 58 // remove Content-Type header if body is empty to avoid sending invalid requests ··· 258 258 }); 259 259 }; 260 260 261 + const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options }); 262 + 261 263 return { 262 - buildUrl, 264 + buildUrl: _buildUrl, 263 265 connect: makeMethodFn('CONNECT'), 264 266 delete: makeMethodFn('DELETE'), 265 267 get: makeMethodFn('GET'),
+6 -8
examples/openapi-ts-nestjs/src/client/core/bodySerializer.gen.ts
··· 4 4 5 5 export type QuerySerializer = (query: Record<string, unknown>) => string; 6 6 7 - export type BodySerializer = (body: any) => any; 7 + export type BodySerializer = (body: unknown) => unknown; 8 8 9 9 type QuerySerializerOptionsObject = { 10 10 allowReserved?: boolean; ··· 39 39 }; 40 40 41 41 export const formDataBodySerializer = { 42 - bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>( 43 - body: T, 44 - ): FormData => { 42 + bodySerializer: (body: unknown): FormData => { 45 43 const data = new FormData(); 46 44 47 - Object.entries(body).forEach(([key, value]) => { 45 + Object.entries(body as Record<string, unknown>).forEach(([key, value]) => { 48 46 if (value === undefined || value === null) { 49 47 return; 50 48 } ··· 60 58 }; 61 59 62 60 export const jsonBodySerializer = { 63 - bodySerializer: <T>(body: T): string => 61 + bodySerializer: (body: unknown): string => 64 62 JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)), 65 63 }; 66 64 67 65 export const urlSearchParamsBodySerializer = { 68 - bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): string => { 66 + bodySerializer: (body: unknown): string => { 69 67 const data = new URLSearchParams(); 70 68 71 - Object.entries(body).forEach(([key, value]) => { 69 + Object.entries(body as Record<string, unknown>).forEach(([key, value]) => { 72 70 if (value === undefined || value === null) { 73 71 return; 74 72 }
+1 -1
examples/openapi-ts-nestjs/src/client/core/params.gen.ts
··· 96 96 97 97 const stripEmptySlots = (params: Params) => { 98 98 for (const [slot, value] of Object.entries(params)) { 99 - if (value && typeof value === 'object' && !Object.keys(value).length) { 99 + if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) { 100 100 delete params[slot as Slot]; 101 101 } 102 102 }