Skip to content

Commit

Permalink
fix: url in text format instead of using URL
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Jan 8, 2025
1 parent bea16a0 commit a51b56d
Show file tree
Hide file tree
Showing 67 changed files with 83 additions and 75 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-beers-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kubb/plugin-client": patch
---

url in text format instead of using URL
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
2 changes: 1 addition & 1 deletion examples/client/src/gen/clients/axios/petService/addPet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
10 changes: 5 additions & 5 deletions examples/client/src/gen/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand All @@ -25,7 +25,7 @@ export async function getInventoryController(config: Partial<RequestConfig> = {}
}

export function getPlaceOrderUrlController() {
return new URL('/store/order')
return '/store/order'
}

/**
Expand All @@ -44,7 +44,7 @@ export async function placeOrderController(data?: PlaceOrderMutationRequest, con
}

export function getPlaceOrderPatchUrlController() {
return new URL('/store/order')
return '/store/order'
}

/**
Expand All @@ -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}`
}

/**
Expand All @@ -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}`
}

/**
Expand Down
2 changes: 1 addition & 1 deletion examples/fetch/src/gen/addPet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
2 changes: 1 addition & 1 deletion examples/fetch/src/gen/createUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
2 changes: 1 addition & 1 deletion examples/fetch/src/gen/createUsersWithListInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

/**
Expand Down
2 changes: 1 addition & 1 deletion examples/fetch/src/gen/deleteOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
2 changes: 1 addition & 1 deletion examples/fetch/src/gen/deletePet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
2 changes: 1 addition & 1 deletion examples/fetch/src/gen/deleteUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}

/**
Expand Down
Loading

0 comments on commit a51b56d

Please sign in to comment.