From a51b56d6f8286a97ae6459d3aa05903644d89cbe Mon Sep 17 00:00:00 2001 From: Stijn Van Hulle Date: Wed, 8 Jan 2025 21:27:28 +0100 Subject: [PATCH] fix: url in text format instead of using URL --- .changeset/healthy-beers-fetch.md | 5 +++++ docs/changelog.md | 3 +++ .../src/gen/clients/axios/petService/addPet.ts | 2 +- .../src/gen/clients/axios/petService/deletePet.ts | 2 +- .../gen/clients/axios/petService/findPetsByStatus.ts | 2 +- .../src/gen/clients/axios/petService/findPetsByTags.ts | 2 +- .../src/gen/clients/axios/petService/getPetById.ts | 2 +- .../src/gen/clients/axios/petService/updatePet.ts | 2 +- .../gen/clients/axios/petService/updatePetWithForm.ts | 2 +- .../src/gen/clients/axios/petService/uploadFile.ts | 2 +- .../src/gen/clients/axios/petsService/createPets.ts | 2 +- .../src/gen/clients/axios/userService/createUser.ts | 2 +- .../axios/userService/createUsersWithListInput.ts | 2 +- .../src/gen/clients/axios/userService/deleteUser.ts | 2 +- .../src/gen/clients/axios/userService/getUserByName.ts | 2 +- .../src/gen/clients/axios/userService/loginUser.ts | 2 +- .../src/gen/clients/axios/userService/logoutUser.ts | 2 +- .../src/gen/clients/axios/userService/updateUser.ts | 2 +- .../client/src/gen/clients/axios/petService/addPet.ts | 2 +- .../src/gen/clients/axios/petService/deletePet.ts | 2 +- .../gen/clients/axios/petService/findPetsByStatus.ts | 2 +- .../src/gen/clients/axios/petService/findPetsByTags.ts | 2 +- .../src/gen/clients/axios/petService/getPetById.ts | 2 +- .../src/gen/clients/axios/petService/updatePet.ts | 2 +- .../gen/clients/axios/petService/updatePetWithForm.ts | 2 +- .../src/gen/clients/axios/petService/uploadFile.ts | 2 +- .../src/gen/clients/axios/userService/createUser.ts | 2 +- .../axios/userService/createUsersWithListInput.ts | 2 +- .../src/gen/clients/axios/userService/deleteUser.ts | 2 +- .../src/gen/clients/axios/userService/getUserByName.ts | 2 +- .../src/gen/clients/axios/userService/loginUser.ts | 2 +- .../src/gen/clients/axios/userService/logoutUser.ts | 2 +- .../src/gen/clients/axios/userService/updateUser.ts | 2 +- examples/client/src/gen/tag.ts | 10 +++++----- examples/fetch/src/gen/addPet.ts | 2 +- examples/fetch/src/gen/createUser.ts | 2 +- examples/fetch/src/gen/createUsersWithListInput.ts | 2 +- examples/fetch/src/gen/deleteOrder.ts | 2 +- examples/fetch/src/gen/deletePet.ts | 2 +- examples/fetch/src/gen/deleteUser.ts | 2 +- examples/fetch/src/gen/findPetsByStatus.ts | 2 +- examples/fetch/src/gen/findPetsByTags.ts | 2 +- examples/fetch/src/gen/getInventory.ts | 2 +- examples/fetch/src/gen/getOrderById.ts | 2 +- examples/fetch/src/gen/getPetById.ts | 2 +- examples/fetch/src/gen/getUserByName.ts | 2 +- examples/fetch/src/gen/loginUser.ts | 2 +- examples/fetch/src/gen/logoutUser.ts | 2 +- examples/fetch/src/gen/placeOrder.ts | 2 +- examples/fetch/src/gen/placeOrderPatch.ts | 2 +- examples/fetch/src/gen/updatePet.ts | 2 +- examples/fetch/src/gen/updatePetWithForm.ts | 2 +- examples/fetch/src/gen/updateUser.ts | 2 +- examples/fetch/src/gen/uploadFile.ts | 2 +- examples/zod/src/gen/zodClients.ts | 10 +++++----- packages/core/src/utils/URLPath.test.ts | 2 +- packages/core/src/utils/URLPath.ts | 6 +++--- packages/plugin-client/src/components/Url.tsx | 2 +- .../src/generators/__snapshots__/deletePet.ts | 2 +- .../src/generators/__snapshots__/deletePetObject.ts | 2 +- .../src/generators/__snapshots__/findByTags.ts | 2 +- .../src/generators/__snapshots__/findByTagsFull.ts | 2 +- .../src/generators/__snapshots__/findByTagsObject.ts | 2 +- .../src/generators/__snapshots__/findByTagsWithZod.ts | 2 +- .../generators/__snapshots__/findByTagsWithZodFull.ts | 2 +- .../src/generators/__snapshots__/importPath.ts | 2 +- .../src/generators/__snapshots__/updatePetById.ts | 2 +- 67 files changed, 83 insertions(+), 75 deletions(-) create mode 100644 .changeset/healthy-beers-fetch.md diff --git a/.changeset/healthy-beers-fetch.md b/.changeset/healthy-beers-fetch.md new file mode 100644 index 000000000..7611558b8 --- /dev/null +++ b/.changeset/healthy-beers-fetch.md @@ -0,0 +1,5 @@ +--- +"@kubb/plugin-client": patch +--- + +url in text format instead of using URL diff --git a/docs/changelog.md b/docs/changelog.md index 2be9129df..dca307e26 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -4,6 +4,9 @@ title: Changelog # Changelog +## 3.4.4 +- [`plugin-client`](/plugins/plugin-client): url in text format instead of using URL + ## 3.4.3 - [`plugin-oas`](/plugins/plugin-oas): correct use of grouping for path and tags diff --git a/examples/advanced/src/gen/clients/axios/petService/addPet.ts b/examples/advanced/src/gen/clients/axios/petService/addPet.ts index 4dda73741..28e449357 100644 --- a/examples/advanced/src/gen/clients/axios/petService/addPet.ts +++ b/examples/advanced/src/gen/clients/axios/petService/addPet.ts @@ -3,7 +3,7 @@ import type { RequestConfig, ResponseErrorConfig } from '../../../../axios-clien import type { AddPetMutationRequest, AddPetMutationResponse, AddPet405 } from '../../../models/ts/petController/AddPet.ts' export function getAddPetUrl() { - return new URL('/pet', 'https://petstore3.swagger.io/api/v3') + return 'https://petstore3.swagger.io/api/v3/pet' } /** diff --git a/examples/advanced/src/gen/clients/axios/petService/deletePet.ts b/examples/advanced/src/gen/clients/axios/petService/deletePet.ts index 6f3334478..781a043ce 100644 --- a/examples/advanced/src/gen/clients/axios/petService/deletePet.ts +++ b/examples/advanced/src/gen/clients/axios/petService/deletePet.ts @@ -3,7 +3,7 @@ import type { RequestConfig, ResponseErrorConfig } from '../../../../axios-clien import type { DeletePetMutationResponse, DeletePetPathParams, DeletePetHeaderParams, DeletePet400 } from '../../../models/ts/petController/DeletePet.ts' export function getDeletePetUrl({ petId }: { petId: DeletePetPathParams['petId'] }) { - return new URL(`/pet/${petId}`, 'https://petstore3.swagger.io/api/v3') + return `https://petstore3.swagger.io/api/v3/pet/${petId}` } /** diff --git a/examples/advanced/src/gen/clients/axios/petService/findPetsByStatus.ts b/examples/advanced/src/gen/clients/axios/petService/findPetsByStatus.ts index 9a70504c8..23917feee 100644 --- a/examples/advanced/src/gen/clients/axios/petService/findPetsByStatus.ts +++ b/examples/advanced/src/gen/clients/axios/petService/findPetsByStatus.ts @@ -3,7 +3,7 @@ import type { RequestConfig, ResponseErrorConfig } from '../../../../axios-clien import type { FindPetsByStatusQueryResponse, FindPetsByStatusPathParams, FindPetsByStatus400 } from '../../../models/ts/petController/FindPetsByStatus.ts' export function getFindPetsByStatusUrl({ step_id }: { step_id: FindPetsByStatusPathParams['step_id'] }) { - return new URL(`/pet/findByStatus/${step_id}`, 'https://petstore3.swagger.io/api/v3') + return `https://petstore3.swagger.io/api/v3/pet/findByStatus/${step_id}` as const } /** diff --git a/examples/advanced/src/gen/clients/axios/petService/findPetsByTags.ts b/examples/advanced/src/gen/clients/axios/petService/findPetsByTags.ts index aa5dc0815..6354569b6 100644 --- a/examples/advanced/src/gen/clients/axios/petService/findPetsByTags.ts +++ b/examples/advanced/src/gen/clients/axios/petService/findPetsByTags.ts @@ -8,7 +8,7 @@ import type { } from '../../../models/ts/petController/FindPetsByTags.ts' export function getFindPetsByTagsUrl() { - return new URL('/pet/findByTags', 'https://petstore3.swagger.io/api/v3') + return 'https://petstore3.swagger.io/api/v3/pet/findByTags' } /** diff --git a/examples/advanced/src/gen/clients/axios/petService/getPetById.ts b/examples/advanced/src/gen/clients/axios/petService/getPetById.ts index 8c0238799..2696f4753 100644 --- a/examples/advanced/src/gen/clients/axios/petService/getPetById.ts +++ b/examples/advanced/src/gen/clients/axios/petService/getPetById.ts @@ -3,7 +3,7 @@ import type { RequestConfig, ResponseErrorConfig } from '../../../../axios-clien import type { GetPetByIdQueryResponse, GetPetByIdPathParams, GetPetById400, GetPetById404 } from '../../../models/ts/petController/GetPetById.ts' export function getGetPetByIdUrl({ petId }: { petId: GetPetByIdPathParams['petId'] }) { - return new URL(`/pet/${petId}`, 'https://petstore3.swagger.io/api/v3') + return `https://petstore3.swagger.io/api/v3/pet/${petId}` } /** diff --git a/examples/advanced/src/gen/clients/axios/petService/updatePet.ts b/examples/advanced/src/gen/clients/axios/petService/updatePet.ts index a130a196a..652e0da6f 100644 --- a/examples/advanced/src/gen/clients/axios/petService/updatePet.ts +++ b/examples/advanced/src/gen/clients/axios/petService/updatePet.ts @@ -9,7 +9,7 @@ import type { } from '../../../models/ts/petController/UpdatePet.ts' export function getUpdatePetUrl() { - return new URL('/pet', 'https://petstore3.swagger.io/api/v3') + return 'https://petstore3.swagger.io/api/v3/pet' } /** diff --git a/examples/advanced/src/gen/clients/axios/petService/updatePetWithForm.ts b/examples/advanced/src/gen/clients/axios/petService/updatePetWithForm.ts index a3b49e895..4962ac061 100644 --- a/examples/advanced/src/gen/clients/axios/petService/updatePetWithForm.ts +++ b/examples/advanced/src/gen/clients/axios/petService/updatePetWithForm.ts @@ -8,7 +8,7 @@ import type { } from '../../../models/ts/petController/UpdatePetWithForm.ts' export function getUpdatePetWithFormUrl({ petId }: { petId: UpdatePetWithFormPathParams['petId'] }) { - return new URL(`/pet/${petId}`, 'https://petstore3.swagger.io/api/v3') + return `https://petstore3.swagger.io/api/v3/pet/${petId}` } /** diff --git a/examples/advanced/src/gen/clients/axios/petService/uploadFile.ts b/examples/advanced/src/gen/clients/axios/petService/uploadFile.ts index 21751081f..73db70b31 100644 --- a/examples/advanced/src/gen/clients/axios/petService/uploadFile.ts +++ b/examples/advanced/src/gen/clients/axios/petService/uploadFile.ts @@ -8,7 +8,7 @@ import type { } from '../../../models/ts/petController/UploadFile.ts' export function getUploadFileUrl({ petId }: { petId: UploadFilePathParams['petId'] }) { - return new URL(`/pet/${petId}/uploadImage`, 'https://petstore3.swagger.io/api/v3') + return `https://petstore3.swagger.io/api/v3/pet/${petId}/uploadImage` } /** diff --git a/examples/advanced/src/gen/clients/axios/petsService/createPets.ts b/examples/advanced/src/gen/clients/axios/petsService/createPets.ts index d1384ccf9..30bd6d008 100644 --- a/examples/advanced/src/gen/clients/axios/petsService/createPets.ts +++ b/examples/advanced/src/gen/clients/axios/petsService/createPets.ts @@ -9,7 +9,7 @@ import type { } from '../../../models/ts/petsController/CreatePets.ts' export function getCreatePetsUrl({ uuid }: { uuid: CreatePetsPathParams['uuid'] }) { - return new URL(`/pets/${uuid}`, 'https://petstore3.swagger.io/api/v3') + return `https://petstore3.swagger.io/api/v3/pets/${uuid}` } /** diff --git a/examples/advanced/src/gen/clients/axios/userService/createUser.ts b/examples/advanced/src/gen/clients/axios/userService/createUser.ts index aed7a7639..06eac0868 100644 --- a/examples/advanced/src/gen/clients/axios/userService/createUser.ts +++ b/examples/advanced/src/gen/clients/axios/userService/createUser.ts @@ -3,7 +3,7 @@ import type { RequestConfig, ResponseErrorConfig } from '../../../../axios-clien import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../../../models/ts/userController/CreateUser.ts' export function getCreateUserUrl() { - return new URL('/user', 'https://petstore3.swagger.io/api/v3') + return 'https://petstore3.swagger.io/api/v3/user' } /** diff --git a/examples/advanced/src/gen/clients/axios/userService/createUsersWithListInput.ts b/examples/advanced/src/gen/clients/axios/userService/createUsersWithListInput.ts index 6378cf965..caf96e1f9 100644 --- a/examples/advanced/src/gen/clients/axios/userService/createUsersWithListInput.ts +++ b/examples/advanced/src/gen/clients/axios/userService/createUsersWithListInput.ts @@ -6,7 +6,7 @@ import type { } from '../../../models/ts/userController/CreateUsersWithListInput.ts' export function getCreateUsersWithListInputUrl() { - return new URL('/user/createWithList', 'https://petstore3.swagger.io/api/v3') + return 'https://petstore3.swagger.io/api/v3/user/createWithList' } /** diff --git a/examples/advanced/src/gen/clients/axios/userService/deleteUser.ts b/examples/advanced/src/gen/clients/axios/userService/deleteUser.ts index c85fa96bc..913a314a1 100644 --- a/examples/advanced/src/gen/clients/axios/userService/deleteUser.ts +++ b/examples/advanced/src/gen/clients/axios/userService/deleteUser.ts @@ -3,7 +3,7 @@ import type { RequestConfig, ResponseErrorConfig } from '../../../../axios-clien import type { DeleteUserMutationResponse, DeleteUserPathParams, DeleteUser400, DeleteUser404 } from '../../../models/ts/userController/DeleteUser.ts' export function getDeleteUserUrl({ username }: { username: DeleteUserPathParams['username'] }) { - return new URL(`/user/${username}`, 'https://petstore3.swagger.io/api/v3') + return `https://petstore3.swagger.io/api/v3/user/${username}` } /** diff --git a/examples/advanced/src/gen/clients/axios/userService/getUserByName.ts b/examples/advanced/src/gen/clients/axios/userService/getUserByName.ts index 1345c574c..97c6964d9 100644 --- a/examples/advanced/src/gen/clients/axios/userService/getUserByName.ts +++ b/examples/advanced/src/gen/clients/axios/userService/getUserByName.ts @@ -8,7 +8,7 @@ import type { } from '../../../models/ts/userController/GetUserByName.ts' export function getGetUserByNameUrl({ username }: { username: GetUserByNamePathParams['username'] }) { - return new URL(`/user/${username}`, 'https://petstore3.swagger.io/api/v3') + return `https://petstore3.swagger.io/api/v3/user/${username}` } /** diff --git a/examples/advanced/src/gen/clients/axios/userService/loginUser.ts b/examples/advanced/src/gen/clients/axios/userService/loginUser.ts index 5238e65a1..f45c6617b 100644 --- a/examples/advanced/src/gen/clients/axios/userService/loginUser.ts +++ b/examples/advanced/src/gen/clients/axios/userService/loginUser.ts @@ -3,7 +3,7 @@ import type { RequestConfig, ResponseErrorConfig } from '../../../../axios-clien import type { LoginUserQueryResponse, LoginUserQueryParams, LoginUser400 } from '../../../models/ts/userController/LoginUser.ts' export function getLoginUserUrl() { - return new URL('/user/login', 'https://petstore3.swagger.io/api/v3') + return 'https://petstore3.swagger.io/api/v3/user/login' } /** diff --git a/examples/advanced/src/gen/clients/axios/userService/logoutUser.ts b/examples/advanced/src/gen/clients/axios/userService/logoutUser.ts index a30f435fa..5d553049c 100644 --- a/examples/advanced/src/gen/clients/axios/userService/logoutUser.ts +++ b/examples/advanced/src/gen/clients/axios/userService/logoutUser.ts @@ -3,7 +3,7 @@ import type { RequestConfig, ResponseErrorConfig } from '../../../../axios-clien import type { LogoutUserQueryResponse } from '../../../models/ts/userController/LogoutUser.ts' export function getLogoutUserUrl() { - return new URL('/user/logout', 'https://petstore3.swagger.io/api/v3') + return 'https://petstore3.swagger.io/api/v3/user/logout' } /** diff --git a/examples/advanced/src/gen/clients/axios/userService/updateUser.ts b/examples/advanced/src/gen/clients/axios/userService/updateUser.ts index ba359a1d6..778942328 100644 --- a/examples/advanced/src/gen/clients/axios/userService/updateUser.ts +++ b/examples/advanced/src/gen/clients/axios/userService/updateUser.ts @@ -3,7 +3,7 @@ import type { RequestConfig, ResponseErrorConfig } from '../../../../axios-clien import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams } from '../../../models/ts/userController/UpdateUser.ts' export function getUpdateUserUrl({ username }: { username: UpdateUserPathParams['username'] }) { - return new URL(`/user/${username}`, 'https://petstore3.swagger.io/api/v3') + return `https://petstore3.swagger.io/api/v3/user/${username}` } /** diff --git a/examples/client/src/gen/clients/axios/petService/addPet.ts b/examples/client/src/gen/clients/axios/petService/addPet.ts index 2f2807f0f..a48e52024 100644 --- a/examples/client/src/gen/clients/axios/petService/addPet.ts +++ b/examples/client/src/gen/clients/axios/petService/addPet.ts @@ -4,7 +4,7 @@ import type { AddPetMutationRequest, AddPetMutationResponse, AddPet405 } from '. import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getAddPetUrl() { - return new URL('/pet') + return '/pet' } /** diff --git a/examples/client/src/gen/clients/axios/petService/deletePet.ts b/examples/client/src/gen/clients/axios/petService/deletePet.ts index 1ad12f96a..ba3bdc4a4 100644 --- a/examples/client/src/gen/clients/axios/petService/deletePet.ts +++ b/examples/client/src/gen/clients/axios/petService/deletePet.ts @@ -4,7 +4,7 @@ import type { DeletePetMutationResponse, DeletePetPathParams, DeletePetHeaderPar import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getDeletePetUrl({ petId }: { petId: DeletePetPathParams['petId'] }) { - return new URL(`/pet/${petId}`) + return `/pet/${petId}` } /** diff --git a/examples/client/src/gen/clients/axios/petService/findPetsByStatus.ts b/examples/client/src/gen/clients/axios/petService/findPetsByStatus.ts index 3de17aa8c..0f6c262e3 100644 --- a/examples/client/src/gen/clients/axios/petService/findPetsByStatus.ts +++ b/examples/client/src/gen/clients/axios/petService/findPetsByStatus.ts @@ -4,7 +4,7 @@ import type { FindPetsByStatusQueryResponse, FindPetsByStatusQueryParams, FindPe import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getFindPetsByStatusUrl() { - return new URL('/pet/findByStatus') + return '/pet/findByStatus' } /** diff --git a/examples/client/src/gen/clients/axios/petService/findPetsByTags.ts b/examples/client/src/gen/clients/axios/petService/findPetsByTags.ts index 353a8746a..dce803475 100644 --- a/examples/client/src/gen/clients/axios/petService/findPetsByTags.ts +++ b/examples/client/src/gen/clients/axios/petService/findPetsByTags.ts @@ -4,7 +4,7 @@ import type { FindPetsByTagsQueryResponse, FindPetsByTagsQueryParams, FindPetsBy import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getFindPetsByTagsUrl() { - return new URL('/pet/findByTags') + return '/pet/findByTags' } /** diff --git a/examples/client/src/gen/clients/axios/petService/getPetById.ts b/examples/client/src/gen/clients/axios/petService/getPetById.ts index c60c827fe..445a7a323 100644 --- a/examples/client/src/gen/clients/axios/petService/getPetById.ts +++ b/examples/client/src/gen/clients/axios/petService/getPetById.ts @@ -4,7 +4,7 @@ import type { GetPetByIdQueryResponse, GetPetByIdPathParams, GetPetById400, GetP import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getGetPetByIdUrl({ petId }: { petId: GetPetByIdPathParams['petId'] }) { - return new URL(`/pet/${petId}`) + return `/pet/${petId}` } /** diff --git a/examples/client/src/gen/clients/axios/petService/updatePet.ts b/examples/client/src/gen/clients/axios/petService/updatePet.ts index ef906d3bf..1025195c5 100644 --- a/examples/client/src/gen/clients/axios/petService/updatePet.ts +++ b/examples/client/src/gen/clients/axios/petService/updatePet.ts @@ -10,7 +10,7 @@ import type { import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getUpdatePetUrl() { - return new URL('/pet') + return '/pet' } /** diff --git a/examples/client/src/gen/clients/axios/petService/updatePetWithForm.ts b/examples/client/src/gen/clients/axios/petService/updatePetWithForm.ts index 50468eb55..e5fe4c099 100644 --- a/examples/client/src/gen/clients/axios/petService/updatePetWithForm.ts +++ b/examples/client/src/gen/clients/axios/petService/updatePetWithForm.ts @@ -9,7 +9,7 @@ import type { import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getUpdatePetWithFormUrl({ petId }: { petId: UpdatePetWithFormPathParams['petId'] }) { - return new URL(`/pet/${petId}`) + return `/pet/${petId}` } /** diff --git a/examples/client/src/gen/clients/axios/petService/uploadFile.ts b/examples/client/src/gen/clients/axios/petService/uploadFile.ts index 621b51c55..9ad1e8232 100644 --- a/examples/client/src/gen/clients/axios/petService/uploadFile.ts +++ b/examples/client/src/gen/clients/axios/petService/uploadFile.ts @@ -9,7 +9,7 @@ import type { import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getUploadFileUrl({ petId }: { petId: UploadFilePathParams['petId'] }) { - return new URL(`/pet/${petId}/uploadImage`) + return `/pet/${petId}/uploadImage` } /** diff --git a/examples/client/src/gen/clients/axios/userService/createUser.ts b/examples/client/src/gen/clients/axios/userService/createUser.ts index 3dd43e003..cc8caa9da 100644 --- a/examples/client/src/gen/clients/axios/userService/createUser.ts +++ b/examples/client/src/gen/clients/axios/userService/createUser.ts @@ -4,7 +4,7 @@ import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../. import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getCreateUserUrl() { - return new URL('/user') + return '/user' } /** diff --git a/examples/client/src/gen/clients/axios/userService/createUsersWithListInput.ts b/examples/client/src/gen/clients/axios/userService/createUsersWithListInput.ts index e3633a964..d9da2ab09 100644 --- a/examples/client/src/gen/clients/axios/userService/createUsersWithListInput.ts +++ b/examples/client/src/gen/clients/axios/userService/createUsersWithListInput.ts @@ -7,7 +7,7 @@ import type { import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getCreateUsersWithListInputUrl() { - return new URL('/user/createWithList') + return '/user/createWithList' } /** diff --git a/examples/client/src/gen/clients/axios/userService/deleteUser.ts b/examples/client/src/gen/clients/axios/userService/deleteUser.ts index d7f9556eb..3f185cf5c 100644 --- a/examples/client/src/gen/clients/axios/userService/deleteUser.ts +++ b/examples/client/src/gen/clients/axios/userService/deleteUser.ts @@ -4,7 +4,7 @@ import type { DeleteUserMutationResponse, DeleteUserPathParams, DeleteUser400, D import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getDeleteUserUrl({ username }: { username: DeleteUserPathParams['username'] }) { - return new URL(`/user/${username}`) + return `/user/${username}` } /** diff --git a/examples/client/src/gen/clients/axios/userService/getUserByName.ts b/examples/client/src/gen/clients/axios/userService/getUserByName.ts index 75535f618..2134b1d7a 100644 --- a/examples/client/src/gen/clients/axios/userService/getUserByName.ts +++ b/examples/client/src/gen/clients/axios/userService/getUserByName.ts @@ -9,7 +9,7 @@ import type { import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getGetUserByNameUrl({ username }: { username: GetUserByNamePathParams['username'] }) { - return new URL(`/user/${username}`) + return `/user/${username}` } /** diff --git a/examples/client/src/gen/clients/axios/userService/loginUser.ts b/examples/client/src/gen/clients/axios/userService/loginUser.ts index 66e084937..9c3636e33 100644 --- a/examples/client/src/gen/clients/axios/userService/loginUser.ts +++ b/examples/client/src/gen/clients/axios/userService/loginUser.ts @@ -4,7 +4,7 @@ import type { LoginUserQueryResponse, LoginUserQueryParams, LoginUser400 } from import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getLoginUserUrl() { - return new URL('/user/login') + return '/user/login' } /** diff --git a/examples/client/src/gen/clients/axios/userService/logoutUser.ts b/examples/client/src/gen/clients/axios/userService/logoutUser.ts index 42bb637ef..b606c1be8 100644 --- a/examples/client/src/gen/clients/axios/userService/logoutUser.ts +++ b/examples/client/src/gen/clients/axios/userService/logoutUser.ts @@ -4,7 +4,7 @@ import type { LogoutUserQueryResponse } from '../../../models/ts/userController/ import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getLogoutUserUrl() { - return new URL('/user/logout') + return '/user/logout' } /** diff --git a/examples/client/src/gen/clients/axios/userService/updateUser.ts b/examples/client/src/gen/clients/axios/userService/updateUser.ts index 358975a49..9a2acb4da 100644 --- a/examples/client/src/gen/clients/axios/userService/updateUser.ts +++ b/examples/client/src/gen/clients/axios/userService/updateUser.ts @@ -4,7 +4,7 @@ import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserP import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getUpdateUserUrl({ username }: { username: UpdateUserPathParams['username'] }) { - return new URL(`/user/${username}`) + return `/user/${username}` } /** diff --git a/examples/client/src/gen/tag.ts b/examples/client/src/gen/tag.ts index ebde97e82..9c259df66 100644 --- a/examples/client/src/gen/tag.ts +++ b/examples/client/src/gen/tag.ts @@ -7,7 +7,7 @@ import type { PlaceOrderPatchMutationRequest, PlaceOrderPatchMutationResponse, P import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getGetInventoryUrlController() { - return new URL('/store/inventory') + return '/store/inventory' } /** @@ -25,7 +25,7 @@ export async function getInventoryController(config: Partial = {} } export function getPlaceOrderUrlController() { - return new URL('/store/order') + return '/store/order' } /** @@ -44,7 +44,7 @@ export async function placeOrderController(data?: PlaceOrderMutationRequest, con } export function getPlaceOrderPatchUrlController() { - return new URL('/store/order') + return '/store/order' } /** @@ -63,7 +63,7 @@ export async function placeOrderPatchController(data?: PlaceOrderPatchMutationRe } export function getGetOrderByIdUrlController(orderId: GetOrderByIdPathParams['orderId']) { - return new URL(`/store/order/${orderId}`) + return `/store/order/${orderId}` } /** @@ -81,7 +81,7 @@ export async function getOrderByIdController(orderId: GetOrderByIdPathParams['or } export function getDeleteOrderUrlController(orderId: DeleteOrderPathParams['orderId']) { - return new URL(`/store/order/${orderId}`) + return `/store/order/${orderId}` } /** diff --git a/examples/fetch/src/gen/addPet.ts b/examples/fetch/src/gen/addPet.ts index de9f5a0b0..9bfc2ab59 100644 --- a/examples/fetch/src/gen/addPet.ts +++ b/examples/fetch/src/gen/addPet.ts @@ -3,7 +3,7 @@ import type { AddPetMutationRequest, AddPetMutationResponse, AddPet405 } from '. import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getAddPetUrl() { - return new URL('/pet') + return '/pet' } /** diff --git a/examples/fetch/src/gen/createUser.ts b/examples/fetch/src/gen/createUser.ts index 2eaada892..3fa35bc4b 100644 --- a/examples/fetch/src/gen/createUser.ts +++ b/examples/fetch/src/gen/createUser.ts @@ -3,7 +3,7 @@ import type { CreateUserMutationRequest, CreateUserMutationResponse } from './mo import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getCreateUserUrl() { - return new URL('/user') + return '/user' } /** diff --git a/examples/fetch/src/gen/createUsersWithListInput.ts b/examples/fetch/src/gen/createUsersWithListInput.ts index 3626f8221..a74d7b7d9 100644 --- a/examples/fetch/src/gen/createUsersWithListInput.ts +++ b/examples/fetch/src/gen/createUsersWithListInput.ts @@ -3,7 +3,7 @@ import type { CreateUsersWithListInputMutationRequest, CreateUsersWithListInputM import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getCreateUsersWithListInputUrl() { - return new URL('/user/createWithList') + return '/user/createWithList' } /** diff --git a/examples/fetch/src/gen/deleteOrder.ts b/examples/fetch/src/gen/deleteOrder.ts index aa3a37d8e..f3058fa01 100644 --- a/examples/fetch/src/gen/deleteOrder.ts +++ b/examples/fetch/src/gen/deleteOrder.ts @@ -3,7 +3,7 @@ import type { DeleteOrderMutationResponse, DeleteOrderPathParams, DeleteOrder400 import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getDeleteOrderUrl(orderId: DeleteOrderPathParams['orderId']) { - return new URL(`/store/order/${orderId}`) + return `/store/order/${orderId}` } /** diff --git a/examples/fetch/src/gen/deletePet.ts b/examples/fetch/src/gen/deletePet.ts index 7a318afa3..7d79a40fc 100644 --- a/examples/fetch/src/gen/deletePet.ts +++ b/examples/fetch/src/gen/deletePet.ts @@ -3,7 +3,7 @@ import type { DeletePetMutationResponse, DeletePetPathParams, DeletePetHeaderPar import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getDeletePetUrl(petId: DeletePetPathParams['petId']) { - return new URL(`/pet/${petId}`) + return `/pet/${petId}` } /** diff --git a/examples/fetch/src/gen/deleteUser.ts b/examples/fetch/src/gen/deleteUser.ts index 537d50d5c..2365d1646 100644 --- a/examples/fetch/src/gen/deleteUser.ts +++ b/examples/fetch/src/gen/deleteUser.ts @@ -3,7 +3,7 @@ import type { DeleteUserMutationResponse, DeleteUserPathParams, DeleteUser400, D import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getDeleteUserUrl(username: DeleteUserPathParams['username']) { - return new URL(`/user/${username}`) + return `/user/${username}` } /** diff --git a/examples/fetch/src/gen/findPetsByStatus.ts b/examples/fetch/src/gen/findPetsByStatus.ts index 2ff46381c..89aa8d485 100644 --- a/examples/fetch/src/gen/findPetsByStatus.ts +++ b/examples/fetch/src/gen/findPetsByStatus.ts @@ -3,7 +3,7 @@ import type { FindPetsByStatusQueryResponse, FindPetsByStatusQueryParams, FindPe import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getFindPetsByStatusUrl() { - return new URL('/pet/findByStatus') + return '/pet/findByStatus' } /** diff --git a/examples/fetch/src/gen/findPetsByTags.ts b/examples/fetch/src/gen/findPetsByTags.ts index 4934d5a31..6f1f682e0 100644 --- a/examples/fetch/src/gen/findPetsByTags.ts +++ b/examples/fetch/src/gen/findPetsByTags.ts @@ -3,7 +3,7 @@ import type { FindPetsByTagsQueryResponse, FindPetsByTagsQueryParams, FindPetsBy import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getFindPetsByTagsUrl() { - return new URL('/pet/findByTags') + return '/pet/findByTags' } /** diff --git a/examples/fetch/src/gen/getInventory.ts b/examples/fetch/src/gen/getInventory.ts index a378a733c..93d02feef 100644 --- a/examples/fetch/src/gen/getInventory.ts +++ b/examples/fetch/src/gen/getInventory.ts @@ -3,7 +3,7 @@ import type { GetInventoryQueryResponse } from './models.ts' import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getGetInventoryUrl() { - return new URL('/store/inventory') + return '/store/inventory' } /** diff --git a/examples/fetch/src/gen/getOrderById.ts b/examples/fetch/src/gen/getOrderById.ts index 8bde98380..81f7e3cb8 100644 --- a/examples/fetch/src/gen/getOrderById.ts +++ b/examples/fetch/src/gen/getOrderById.ts @@ -3,7 +3,7 @@ import type { GetOrderByIdQueryResponse, GetOrderByIdPathParams, GetOrderById400 import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getGetOrderByIdUrl(orderId: GetOrderByIdPathParams['orderId']) { - return new URL(`/store/order/${orderId}`) + return `/store/order/${orderId}` } /** diff --git a/examples/fetch/src/gen/getPetById.ts b/examples/fetch/src/gen/getPetById.ts index 1aa0b71e9..dcca1e61c 100644 --- a/examples/fetch/src/gen/getPetById.ts +++ b/examples/fetch/src/gen/getPetById.ts @@ -3,7 +3,7 @@ import type { GetPetByIdQueryResponse, GetPetByIdPathParams, GetPetById400, GetP import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getGetPetByIdUrl(petId: GetPetByIdPathParams['petId']) { - return new URL(`/pet/${petId}`) + return `/pet/${petId}` } /** diff --git a/examples/fetch/src/gen/getUserByName.ts b/examples/fetch/src/gen/getUserByName.ts index 353356ee8..7ced19a5e 100644 --- a/examples/fetch/src/gen/getUserByName.ts +++ b/examples/fetch/src/gen/getUserByName.ts @@ -3,7 +3,7 @@ import type { GetUserByNameQueryResponse, GetUserByNamePathParams, GetUserByName import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getGetUserByNameUrl(username: GetUserByNamePathParams['username']) { - return new URL(`/user/${username}`) + return `/user/${username}` } /** diff --git a/examples/fetch/src/gen/loginUser.ts b/examples/fetch/src/gen/loginUser.ts index dc6422ec2..74bd302ae 100644 --- a/examples/fetch/src/gen/loginUser.ts +++ b/examples/fetch/src/gen/loginUser.ts @@ -3,7 +3,7 @@ import type { LoginUserQueryResponse, LoginUserQueryParams, LoginUser400 } from import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getLoginUserUrl() { - return new URL('/user/login') + return '/user/login' } /** diff --git a/examples/fetch/src/gen/logoutUser.ts b/examples/fetch/src/gen/logoutUser.ts index 262a55721..f7e6c4e38 100644 --- a/examples/fetch/src/gen/logoutUser.ts +++ b/examples/fetch/src/gen/logoutUser.ts @@ -3,7 +3,7 @@ import type { LogoutUserQueryResponse } from './models.ts' import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getLogoutUserUrl() { - return new URL('/user/logout') + return '/user/logout' } /** diff --git a/examples/fetch/src/gen/placeOrder.ts b/examples/fetch/src/gen/placeOrder.ts index 311813fc9..d12e57073 100644 --- a/examples/fetch/src/gen/placeOrder.ts +++ b/examples/fetch/src/gen/placeOrder.ts @@ -3,7 +3,7 @@ import type { PlaceOrderMutationRequest, PlaceOrderMutationResponse, PlaceOrder4 import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getPlaceOrderUrl() { - return new URL('/store/order') + return '/store/order' } /** diff --git a/examples/fetch/src/gen/placeOrderPatch.ts b/examples/fetch/src/gen/placeOrderPatch.ts index cc7a90509..77311bb03 100644 --- a/examples/fetch/src/gen/placeOrderPatch.ts +++ b/examples/fetch/src/gen/placeOrderPatch.ts @@ -3,7 +3,7 @@ import type { PlaceOrderPatchMutationRequest, PlaceOrderPatchMutationResponse, P import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getPlaceOrderPatchUrl() { - return new URL('/store/order') + return '/store/order' } /** diff --git a/examples/fetch/src/gen/updatePet.ts b/examples/fetch/src/gen/updatePet.ts index 925195cd2..f11454e34 100644 --- a/examples/fetch/src/gen/updatePet.ts +++ b/examples/fetch/src/gen/updatePet.ts @@ -3,7 +3,7 @@ import type { UpdatePetMutationRequest, UpdatePetMutationResponse, UpdatePet400, import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getUpdatePetUrl() { - return new URL('/pet') + return '/pet' } /** diff --git a/examples/fetch/src/gen/updatePetWithForm.ts b/examples/fetch/src/gen/updatePetWithForm.ts index cf98efffc..c0d8579ab 100644 --- a/examples/fetch/src/gen/updatePetWithForm.ts +++ b/examples/fetch/src/gen/updatePetWithForm.ts @@ -3,7 +3,7 @@ import type { UpdatePetWithFormMutationResponse, UpdatePetWithFormPathParams, Up import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getUpdatePetWithFormUrl(petId: UpdatePetWithFormPathParams['petId']) { - return new URL(`/pet/${petId}`) + return `/pet/${petId}` } /** diff --git a/examples/fetch/src/gen/updateUser.ts b/examples/fetch/src/gen/updateUser.ts index f213c27d6..31c8ce1c6 100644 --- a/examples/fetch/src/gen/updateUser.ts +++ b/examples/fetch/src/gen/updateUser.ts @@ -3,7 +3,7 @@ import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserP import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getUpdateUserUrl(username: UpdateUserPathParams['username']) { - return new URL(`/user/${username}`) + return `/user/${username}` } /** diff --git a/examples/fetch/src/gen/uploadFile.ts b/examples/fetch/src/gen/uploadFile.ts index d27d31005..26f312b51 100644 --- a/examples/fetch/src/gen/uploadFile.ts +++ b/examples/fetch/src/gen/uploadFile.ts @@ -3,7 +3,7 @@ import type { UploadFileMutationRequest, UploadFileMutationResponse, UploadFileP import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/fetch' export function getUploadFileUrl(petId: UploadFilePathParams['petId']) { - return new URL(`/pet/${petId}/uploadImage`) + return `/pet/${petId}/uploadImage` } /** diff --git a/examples/zod/src/gen/zodClients.ts b/examples/zod/src/gen/zodClients.ts index 197061655..dbc529146 100644 --- a/examples/zod/src/gen/zodClients.ts +++ b/examples/zod/src/gen/zodClients.ts @@ -12,7 +12,7 @@ import { placeOrderPatchMutationResponseSchema } from './zod/placeOrderPatchSche import { placeOrderMutationResponseSchema } from './zod/placeOrderSchema.gen.ts' export function getGetInventoryUrl() { - return new URL('/store/inventory') + return '/store/inventory' } /** @@ -30,7 +30,7 @@ export async function getInventory(config: Partial = {}) { } export function getPlaceOrderUrl() { - return new URL('/store/order') + return '/store/order' } /** @@ -49,7 +49,7 @@ export async function placeOrder(data?: PlaceOrderMutationRequestType, config: P } export function getPlaceOrderPatchUrl() { - return new URL('/store/order') + return '/store/order' } /** @@ -68,7 +68,7 @@ export async function placeOrderPatch(data?: PlaceOrderPatchMutationRequestType, } export function getGetOrderByIdUrl({ orderId }: { orderId: GetOrderByIdPathParamsType['orderId'] }) { - return new URL(`/store/order/${orderId}`) + return `/store/order/${orderId}` } /** @@ -86,7 +86,7 @@ export async function getOrderById({ orderId }: { orderId: GetOrderByIdPathParam } export function getDeleteOrderUrl({ orderId }: { orderId: DeleteOrderPathParamsType['orderId'] }) { - return new URL(`/store/order/${orderId}`) + return `/store/order/${orderId}` } /** diff --git a/packages/core/src/utils/URLPath.test.ts b/packages/core/src/utils/URLPath.test.ts index 1b973d1cc..72ab2a8dc 100644 --- a/packages/core/src/utils/URLPath.test.ts +++ b/packages/core/src/utils/URLPath.test.ts @@ -10,7 +10,7 @@ describe('URLPath', () => { }) test('if templateStrings returns correct format with replacer', () => { - expect(simplePath.toTemplateString((item) => `unref(${item})`)).toBe('`/user/${unref(userID)}`') + expect(simplePath.toTemplateString({replacer: (item) => `unref(${item})`})).toBe('`/user/${unref(userID)}`') expect(simplePath.template).toBe('`/user/${userID}`') }) diff --git a/packages/core/src/utils/URLPath.ts b/packages/core/src/utils/URLPath.ts index b6588dad1..6dbadbff1 100644 --- a/packages/core/src/utils/URLPath.ts +++ b/packages/core/src/utils/URLPath.ts @@ -63,7 +63,7 @@ export class URLPath { toObject({ type = 'path', replacer, stringify }: ObjectOptions = {}): URLObject | string { const object = { - url: type === 'path' ? this.toURLPath() : this.toTemplateString(replacer), + url: type === 'path' ? this.toURLPath() : this.toTemplateString({ replacer }), params: this.getParams(), } @@ -88,7 +88,7 @@ export class URLPath { * @example /account/monetary-accountID => `/account/${monetaryAccountId}` * @example /account/userID => `/account/${userId}` */ - toTemplateString(replacer?: (pathParam: string) => string): string { + toTemplateString({ prefix = '', replacer }: { prefix?: string; replacer?: (pathParam: string) => string } = {}): string { const regex = /{(\w|-)*}/g const found = this.path.match(regex) let newPath = this.path.replaceAll('{', '${') @@ -107,7 +107,7 @@ export class URLPath { }, this.path) } - return `\`${newPath}\`` + return `\`${prefix}${newPath}\`` } getParams(replacer?: (pathParam: string) => string): Record | undefined { diff --git a/packages/plugin-client/src/components/Url.tsx b/packages/plugin-client/src/components/Url.tsx index 5892ee455..7d8569ede 100644 --- a/packages/plugin-client/src/components/Url.tsx +++ b/packages/plugin-client/src/components/Url.tsx @@ -59,7 +59,7 @@ export function Url({ name, isExportable = true, isIndexable = true, typeSchemas return ( - {baseURL ? `return new URL(${path.template.toString()}, '${baseURL}')` : `return new URL(${path.template.toString()})`} + {`return ${path.toTemplateString({ prefix: baseURL })} as const`} ) diff --git a/packages/plugin-client/src/generators/__snapshots__/deletePet.ts b/packages/plugin-client/src/generators/__snapshots__/deletePet.ts index 684036ecf..60963ad7b 100644 --- a/packages/plugin-client/src/generators/__snapshots__/deletePet.ts +++ b/packages/plugin-client/src/generators/__snapshots__/deletePet.ts @@ -3,7 +3,7 @@ import client from '@kubb/plugin-client/clients/axios' import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getDeletePetUrl(petId: DeletePetPathParams['petId']) { - return new URL(`/pet/${petId}`) + return `/pet/${petId}` as const } /** diff --git a/packages/plugin-client/src/generators/__snapshots__/deletePetObject.ts b/packages/plugin-client/src/generators/__snapshots__/deletePetObject.ts index 15bd9823e..6a26e1b58 100644 --- a/packages/plugin-client/src/generators/__snapshots__/deletePetObject.ts +++ b/packages/plugin-client/src/generators/__snapshots__/deletePetObject.ts @@ -3,7 +3,7 @@ import client from '@kubb/plugin-client/clients/axios' import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getDeletePetUrl({ petId }: { petId: DeletePetPathParams['petId'] }) { - return new URL(`/pet/${petId}`) + return `/pet/${petId}` as const } /** diff --git a/packages/plugin-client/src/generators/__snapshots__/findByTags.ts b/packages/plugin-client/src/generators/__snapshots__/findByTags.ts index 0ac114993..d3ecd52f5 100644 --- a/packages/plugin-client/src/generators/__snapshots__/findByTags.ts +++ b/packages/plugin-client/src/generators/__snapshots__/findByTags.ts @@ -3,7 +3,7 @@ import client from '@kubb/plugin-client/clients/axios' import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getFindPetsByTagsUrl() { - return new URL(`/pet/findByTags`) + return `/pet/findByTags` as const } /** diff --git a/packages/plugin-client/src/generators/__snapshots__/findByTagsFull.ts b/packages/plugin-client/src/generators/__snapshots__/findByTagsFull.ts index 0c6ae68d1..177ac241e 100644 --- a/packages/plugin-client/src/generators/__snapshots__/findByTagsFull.ts +++ b/packages/plugin-client/src/generators/__snapshots__/findByTagsFull.ts @@ -3,7 +3,7 @@ import client from '@kubb/plugin-client/clients/axios' import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getFindPetsByTagsUrl() { - return new URL(`/pet/findByTags`) + return `/pet/findByTags` as const } /** diff --git a/packages/plugin-client/src/generators/__snapshots__/findByTagsObject.ts b/packages/plugin-client/src/generators/__snapshots__/findByTagsObject.ts index 3a445cdf4..92a5460c1 100644 --- a/packages/plugin-client/src/generators/__snapshots__/findByTagsObject.ts +++ b/packages/plugin-client/src/generators/__snapshots__/findByTagsObject.ts @@ -3,7 +3,7 @@ import client from '@kubb/plugin-client/clients/axios' import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getFindPetsByTagsUrl() { - return new URL(`/pet/findByTags`) + return `/pet/findByTags` as const } /** diff --git a/packages/plugin-client/src/generators/__snapshots__/findByTagsWithZod.ts b/packages/plugin-client/src/generators/__snapshots__/findByTagsWithZod.ts index e6f6397ea..5bf429e52 100644 --- a/packages/plugin-client/src/generators/__snapshots__/findByTagsWithZod.ts +++ b/packages/plugin-client/src/generators/__snapshots__/findByTagsWithZod.ts @@ -3,7 +3,7 @@ import client from '@kubb/plugin-client/clients/axios' import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getFindPetsByTagsUrl() { - return new URL(`/pet/findByTags`) + return `/pet/findByTags` as const } /** diff --git a/packages/plugin-client/src/generators/__snapshots__/findByTagsWithZodFull.ts b/packages/plugin-client/src/generators/__snapshots__/findByTagsWithZodFull.ts index e78805c68..c599e4fdd 100644 --- a/packages/plugin-client/src/generators/__snapshots__/findByTagsWithZodFull.ts +++ b/packages/plugin-client/src/generators/__snapshots__/findByTagsWithZodFull.ts @@ -3,7 +3,7 @@ import client from '@kubb/plugin-client/clients/axios' import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getFindPetsByTagsUrl() { - return new URL(`/pet/findByTags`) + return `/pet/findByTags` as const } /** diff --git a/packages/plugin-client/src/generators/__snapshots__/importPath.ts b/packages/plugin-client/src/generators/__snapshots__/importPath.ts index 53c666b93..fe73bc50f 100644 --- a/packages/plugin-client/src/generators/__snapshots__/importPath.ts +++ b/packages/plugin-client/src/generators/__snapshots__/importPath.ts @@ -3,7 +3,7 @@ import client from 'axios' import type { RequestConfig, ResponseErrorConfig } from 'axios' export function getFindPetsByTagsUrl() { - return new URL(`/pet/findByTags`) + return `/pet/findByTags` as const } /** diff --git a/packages/plugin-client/src/generators/__snapshots__/updatePetById.ts b/packages/plugin-client/src/generators/__snapshots__/updatePetById.ts index 070b5eb60..0f2924e60 100644 --- a/packages/plugin-client/src/generators/__snapshots__/updatePetById.ts +++ b/packages/plugin-client/src/generators/__snapshots__/updatePetById.ts @@ -3,7 +3,7 @@ import client from '@kubb/plugin-client/clients/axios' import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios' export function getUpdatePetWithFormUrl(petId: UpdatePetWithFormPathParams['petId']) { - return new URL(`/pet/${petId}`) + return `/pet/${petId}` as const } /**