Skip to content

Commit d2c3705

Browse files
authored
Merge pull request #3491 from hey-api/copilot/fix-client-build-url-defaults
fix: `client.buildUrl` includes `baseUrl` from client config by default
2 parents 12ddb0d + c0cbffb commit d2c3705

271 files changed

Lines changed: 924 additions & 263 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/khaki-eyes-drop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/openapi-ts": minor
3+
---
4+
5+
**BREAKING** **client**: `buildUrl()` function includes `baseUrl` from config by default

examples/openapi-ts-angular-common/src/client/client/client.gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ export const createClient = (config: Config = {}): Client => {
199199
});
200200
};
201201

202+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
203+
202204
return {
203-
buildUrl,
205+
buildUrl: _buildUrl,
204206
connect: makeMethodFn('CONNECT'),
205207
delete: makeMethodFn('DELETE'),
206208
get: makeMethodFn('GET'),

examples/openapi-ts-angular/src/client/client/client.gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ export const createClient = (config: Config = {}): Client => {
199199
});
200200
};
201201

202+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
203+
202204
return {
203-
buildUrl,
205+
buildUrl: _buildUrl,
204206
connect: makeMethodFn('CONNECT'),
205207
delete: makeMethodFn('DELETE'),
206208
get: makeMethodFn('GET'),

examples/openapi-ts-axios/src/client/client/client.gen.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,11 @@ export const createClient = (config: Config = {}): Client => {
126126
});
127127
};
128128

129+
const _buildUrl: Client['buildUrl'] = (options) =>
130+
buildUrl({ axios: instance, ..._config, ...options });
131+
129132
return {
130-
buildUrl,
133+
buildUrl: _buildUrl,
131134
connect: makeMethodFn('CONNECT'),
132135
delete: makeMethodFn('DELETE'),
133136
get: makeMethodFn('GET'),

examples/openapi-ts-fastify/src/client/client/client.gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
258258
});
259259
};
260260

261+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
262+
261263
return {
262-
buildUrl,
264+
buildUrl: _buildUrl,
263265
connect: makeMethodFn('CONNECT'),
264266
delete: makeMethodFn('DELETE'),
265267
get: makeMethodFn('GET'),

examples/openapi-ts-fetch/src/client/client/client.gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
258258
});
259259
};
260260

261+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
262+
261263
return {
262-
buildUrl,
264+
buildUrl: _buildUrl,
263265
connect: makeMethodFn('CONNECT'),
264266
delete: makeMethodFn('DELETE'),
265267
get: makeMethodFn('GET'),

examples/openapi-ts-ky/src/client/client/client.gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,10 @@ export const createClient = (config: Config = {}): Client => {
296296
});
297297
};
298298

299+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
300+
299301
return {
300-
buildUrl,
302+
buildUrl: _buildUrl,
301303
connect: makeMethodFn('CONNECT'),
302304
delete: makeMethodFn('DELETE'),
303305
get: makeMethodFn('GET'),

examples/openapi-ts-next/src/client/client/client.gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ export const createClient = (config: Config = {}): Client => {
225225
});
226226
};
227227

228+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
229+
228230
return {
229-
buildUrl,
231+
buildUrl: _buildUrl,
230232
connect: makeMethodFn('CONNECT'),
231233
delete: makeMethodFn('DELETE'),
232234
get: makeMethodFn('GET'),

examples/openapi-ts-ofetch/src/client/client/client.gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,10 @@ export const createClient = (config: Config = {}): Client => {
231231
});
232232
};
233233

234+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
235+
234236
return {
235-
buildUrl,
237+
buildUrl: _buildUrl,
236238
connect: makeMethodFn('CONNECT'),
237239
delete: makeMethodFn('DELETE'),
238240
get: makeMethodFn('GET'),

examples/openapi-ts-openai/src/client/client/client.gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
258258
});
259259
};
260260

261+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
262+
261263
return {
262-
buildUrl,
264+
buildUrl: _buildUrl,
263265
connect: makeMethodFn('CONNECT'),
264266
delete: makeMethodFn('DELETE'),
265267
get: makeMethodFn('GET'),

0 commit comments

Comments
 (0)