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

test: update examples

Lubos 016be62c 31e44a4e

+490 -164
+1 -1
examples/openapi-ts-angular-common/src/client/client/types.gen.ts
··· 253 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 254 'body' | 'path' | 'query' | 'url' 255 > & 256 - Omit<TData, 'url'>; 257 258 export type OptionsLegacyParser< 259 TData = unknown,
··· 253 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 254 'body' | 'path' | 'query' | 'url' 255 > & 256 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 257 258 export type OptionsLegacyParser< 259 TData = unknown,
+34 -11
examples/openapi-ts-angular-common/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-angular/src/client/client/types.gen.ts
··· 253 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 254 'body' | 'path' | 'query' | 'url' 255 > & 256 - Omit<TData, 'url'>; 257 258 export type OptionsLegacyParser< 259 TData = unknown,
··· 253 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 254 'body' | 'path' | 'query' | 'url' 255 > & 256 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 257 258 export type OptionsLegacyParser< 259 TData = unknown,
+34 -11
examples/openapi-ts-angular/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-axios/src/client/client/types.gen.ts
··· 194 RequestOptions<TResponse, ThrowOnError>, 195 'body' | 'path' | 'query' | 'url' 196 > & 197 - Omit<TData, 'url'>; 198 199 export type OptionsLegacyParser< 200 TData = unknown,
··· 194 RequestOptions<TResponse, ThrowOnError>, 195 'body' | 'path' | 'query' | 'url' 196 > & 197 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 198 199 export type OptionsLegacyParser< 200 TData = unknown,
+34 -11
examples/openapi-ts-axios/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-fastify/src/client/client/types.gen.ts
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 - Omit<TData, 'url'>; 242 243 export type OptionsLegacyParser< 244 TData = unknown,
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 242 243 export type OptionsLegacyParser< 244 TData = unknown,
+34 -11
examples/openapi-ts-fastify/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-fetch/src/client/client/types.gen.ts
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 - Omit<TData, 'url'>; 242 243 export type OptionsLegacyParser< 244 TData = unknown,
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 242 243 export type OptionsLegacyParser< 244 TData = unknown,
+34 -11
examples/openapi-ts-fetch/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-next/src/client/client/types.gen.ts
··· 195 RequestOptions<TResponse, ThrowOnError>, 196 'body' | 'path' | 'query' | 'url' 197 > & 198 - Omit<TData, 'url'>; 199 200 export type OptionsLegacyParser< 201 TData = unknown,
··· 195 RequestOptions<TResponse, ThrowOnError>, 196 'body' | 'path' | 'query' | 'url' 197 > & 198 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 199 200 export type OptionsLegacyParser< 201 TData = unknown,
+34 -11
examples/openapi-ts-next/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-ofetch/src/client/client/types.gen.ts
··· 305 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 306 'body' | 'path' | 'query' | 'url' 307 > & 308 - Omit<TData, 'url'>; 309 310 export type OptionsLegacyParser< 311 TData = unknown,
··· 305 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 306 'body' | 'path' | 'query' | 'url' 307 > & 308 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 309 310 export type OptionsLegacyParser< 311 TData = unknown,
+34 -11
examples/openapi-ts-ofetch/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-openai/src/client/client/types.gen.ts
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 - Omit<TData, 'url'>; 242 243 export type OptionsLegacyParser< 244 TData = unknown,
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 242 243 export type OptionsLegacyParser< 244 TData = unknown,
+34 -11
examples/openapi-ts-openai/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-pinia-colada/src/client/client/types.gen.ts
··· 206 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 207 'body' | 'path' | 'query' | 'url' 208 > & 209 - Omit<TData, 'url'> 210 211 export type OptionsLegacyParser< 212 TData = unknown,
··· 206 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 207 'body' | 'path' | 'query' | 'url' 208 > & 209 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>) 210 211 export type OptionsLegacyParser< 212 TData = unknown,
+34 -9
examples/openapi-ts-pinia-colada/src/client/core/params.gen.ts
··· 23 key?: string 24 map?: string 25 } 26 27 export interface Fields { 28 allowExtra?: Partial<Record<Slot, boolean>> ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot 46 - map?: string 47 - } 48 > 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map 61 }) 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map) 65 } ··· 108 if (config.key) { 109 const field = map.get(config.key)! 110 const name = field.map || config.key 111 - ;(params[field.in] as Record<string, unknown>)[name] = arg 112 } else { 113 params.body = arg 114 } ··· 117 const field = map.get(key) 118 119 if (field) { 120 - const name = field.map || key 121 - ;(params[field.in] as Record<string, unknown>)[name] = value 122 } else { 123 const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)) 124 125 if (extra) { 126 const [prefix, slot] = extra 127 ;(params[slot] as Record<string, unknown>)[key.slice(prefix.length)] = value 128 - } else { 129 - for (const [slot, allowed] of Object.entries(config.allowExtra ?? {})) { 130 if (allowed) { 131 ;(params[slot as Slot] as Record<string, unknown>)[key] = value 132 break
··· 23 key?: string 24 map?: string 25 } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot 36 + } 37 38 export interface Fields { 39 allowExtra?: Partial<Record<Slot, boolean>> ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot 57 + map?: string 58 + } 59 + | { 60 + in?: never 61 + map: Slot 62 + } 63 > 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map 76 }) 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map 81 + }) 82 } else if (config.args) { 83 buildKeyMap(config.args, map) 84 } ··· 127 if (config.key) { 128 const field = map.get(config.key)! 129 const name = field.map || config.key 130 + if (field.in) { 131 + ;(params[field.in] as Record<string, unknown>)[name] = arg 132 + } 133 } else { 134 params.body = arg 135 } ··· 138 const field = map.get(key) 139 140 if (field) { 141 + if (field.in) { 142 + const name = field.map || key 143 + ;(params[field.in] as Record<string, unknown>)[name] = value 144 + } else { 145 + params[field.map] = value 146 + } 147 } else { 148 const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)) 149 150 if (extra) { 151 const [prefix, slot] = extra 152 ;(params[slot] as Record<string, unknown>)[key.slice(prefix.length)] = value 153 + } else if ('allowExtra' in config && config.allowExtra) { 154 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 155 if (allowed) { 156 ;(params[slot as Slot] as Record<string, unknown>)[key] = value 157 break
+1 -1
examples/openapi-ts-sample/src/client/client/types.gen.ts
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 - Omit<TData, 'url'>; 242 243 export type OptionsLegacyParser< 244 TData = unknown,
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 242 243 export type OptionsLegacyParser< 244 TData = unknown,
+34 -11
examples/openapi-ts-sample/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-tanstack-angular-query-experimental/src/client/client/types.gen.ts
··· 253 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 254 'body' | 'path' | 'query' | 'url' 255 > & 256 - Omit<TData, 'url'>; 257 258 export type OptionsLegacyParser< 259 TData = unknown,
··· 253 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 254 'body' | 'path' | 'query' | 'url' 255 > & 256 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 257 258 export type OptionsLegacyParser< 259 TData = unknown,
+34 -11
examples/openapi-ts-tanstack-angular-query-experimental/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-tanstack-react-query/src/client/client/types.gen.ts
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 - Omit<TData, 'url'>; 242 243 export type OptionsLegacyParser< 244 TData = unknown,
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 242 243 export type OptionsLegacyParser< 244 TData = unknown,
+34 -11
examples/openapi-ts-tanstack-react-query/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-tanstack-svelte-query/src/client/client/types.gen.ts
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 - Omit<TData, 'url'>; 242 243 export type OptionsLegacyParser< 244 TData = unknown,
··· 238 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 239 'body' | 'path' | 'query' | 'url' 240 > & 241 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>); 242 243 export type OptionsLegacyParser< 244 TData = unknown,
+34 -11
examples/openapi-ts-tanstack-svelte-query/src/client/core/params.gen.ts
··· 22 */ 23 key?: string; 24 map?: string; 25 }; 26 27 export interface Fields { ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot; 46 - map?: string; 47 - } 48 >; 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map, 61 }); 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map); 65 } ··· 111 if (config.key) { 112 const field = map.get(config.key)!; 113 const name = field.map || config.key; 114 - (params[field.in] as Record<string, unknown>)[name] = arg; 115 } else { 116 params.body = arg; 117 } ··· 120 const field = map.get(key); 121 122 if (field) { 123 - const name = field.map || key; 124 - (params[field.in] as Record<string, unknown>)[name] = value; 125 } else { 126 const extra = extraPrefixes.find(([prefix]) => 127 key.startsWith(prefix), ··· 132 (params[slot] as Record<string, unknown>)[ 133 key.slice(prefix.length) 134 ] = value; 135 - } else { 136 - for (const [slot, allowed] of Object.entries( 137 - config.allowExtra ?? {}, 138 - )) { 139 if (allowed) { 140 (params[slot as Slot] as Record<string, unknown>)[key] = value; 141 break;
··· 22 */ 23 key?: string; 24 map?: string; 25 + } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string; 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot; 36 }; 37 38 export interface Fields { ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot; 57 + map?: string; 58 + } 59 + | { 60 + in?: never; 61 + map: Slot; 62 + } 63 >; 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map, 76 }); 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map, 81 + }); 82 } else if (config.args) { 83 buildKeyMap(config.args, map); 84 } ··· 130 if (config.key) { 131 const field = map.get(config.key)!; 132 const name = field.map || config.key; 133 + if (field.in) { 134 + (params[field.in] as Record<string, unknown>)[name] = arg; 135 + } 136 } else { 137 params.body = arg; 138 } ··· 141 const field = map.get(key); 142 143 if (field) { 144 + if (field.in) { 145 + const name = field.map || key; 146 + (params[field.in] as Record<string, unknown>)[name] = value; 147 + } else { 148 + params[field.map] = value; 149 + } 150 } else { 151 const extra = extraPrefixes.find(([prefix]) => 152 key.startsWith(prefix), ··· 157 (params[slot] as Record<string, unknown>)[ 158 key.slice(prefix.length) 159 ] = value; 160 + } else if ('allowExtra' in config && config.allowExtra) { 161 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 162 if (allowed) { 163 (params[slot as Slot] as Record<string, unknown>)[key] = value; 164 break;
+1 -1
examples/openapi-ts-tanstack-vue-query/src/client/client/types.gen.ts
··· 206 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 207 'body' | 'path' | 'query' | 'url' 208 > & 209 - Omit<TData, 'url'> 210 211 export type OptionsLegacyParser< 212 TData = unknown,
··· 206 RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 207 'body' | 'path' | 'query' | 'url' 208 > & 209 + ([TData] extends [never] ? unknown : Omit<TData, 'url'>) 210 211 export type OptionsLegacyParser< 212 TData = unknown,
+34 -9
examples/openapi-ts-tanstack-vue-query/src/client/core/params.gen.ts
··· 23 key?: string 24 map?: string 25 } 26 27 export interface Fields { 28 allowExtra?: Partial<Record<Slot, boolean>> ··· 41 42 type KeyMap = Map< 43 string, 44 - { 45 - in: Slot 46 - map?: string 47 - } 48 > 49 50 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 60 map: config.map 61 }) 62 } 63 } else if (config.args) { 64 buildKeyMap(config.args, map) 65 } ··· 108 if (config.key) { 109 const field = map.get(config.key)! 110 const name = field.map || config.key 111 - ;(params[field.in] as Record<string, unknown>)[name] = arg 112 } else { 113 params.body = arg 114 } ··· 117 const field = map.get(key) 118 119 if (field) { 120 - const name = field.map || key 121 - ;(params[field.in] as Record<string, unknown>)[name] = value 122 } else { 123 const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)) 124 125 if (extra) { 126 const [prefix, slot] = extra 127 ;(params[slot] as Record<string, unknown>)[key.slice(prefix.length)] = value 128 - } else { 129 - for (const [slot, allowed] of Object.entries(config.allowExtra ?? {})) { 130 if (allowed) { 131 ;(params[slot as Slot] as Record<string, unknown>)[key] = value 132 break
··· 23 key?: string 24 map?: string 25 } 26 + | { 27 + /** 28 + * Field name. This is the name we want the user to see and use. 29 + */ 30 + key: string 31 + /** 32 + * Field mapped name. This is the name we want to use in the request. 33 + * If `in` is omitted, `map` aliases `key` to the transport layer. 34 + */ 35 + map: Slot 36 + } 37 38 export interface Fields { 39 allowExtra?: Partial<Record<Slot, boolean>> ··· 52 53 type KeyMap = Map< 54 string, 55 + | { 56 + in: Slot 57 + map?: string 58 + } 59 + | { 60 + in?: never 61 + map: Slot 62 + } 63 > 64 65 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { ··· 75 map: config.map 76 }) 77 } 78 + } else if ('key' in config) { 79 + map.set(config.key, { 80 + map: config.map 81 + }) 82 } else if (config.args) { 83 buildKeyMap(config.args, map) 84 } ··· 127 if (config.key) { 128 const field = map.get(config.key)! 129 const name = field.map || config.key 130 + if (field.in) { 131 + ;(params[field.in] as Record<string, unknown>)[name] = arg 132 + } 133 } else { 134 params.body = arg 135 } ··· 138 const field = map.get(key) 139 140 if (field) { 141 + if (field.in) { 142 + const name = field.map || key 143 + ;(params[field.in] as Record<string, unknown>)[name] = value 144 + } else { 145 + params[field.map] = value 146 + } 147 } else { 148 const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)) 149 150 if (extra) { 151 const [prefix, slot] = extra 152 ;(params[slot] as Record<string, unknown>)[key.slice(prefix.length)] = value 153 + } else if ('allowExtra' in config && config.allowExtra) { 154 + for (const [slot, allowed] of Object.entries(config.allowExtra)) { 155 if (allowed) { 156 ;(params[slot as Slot] as Record<string, unknown>)[key] = value 157 break