diff --git a/examples/advanced/src/gen/clients/axios/petService/addPet.ts b/examples/advanced/src/gen/clients/axios/petService/addPet.ts index 6858c8270..ba91fb42f 100644 --- a/examples/advanced/src/gen/clients/axios/petService/addPet.ts +++ b/examples/advanced/src/gen/clients/axios/petService/addPet.ts @@ -7,11 +7,11 @@ import type { AddPetMutationRequest, AddPetMutationResponse } from '../../../mod * @summary Add a new pet to the store * @link /pet */ -export async function addPet( - data: TVariables, +export async function addPet( + data: AddPetMutationRequest, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'post', url: `/pet`, data, diff --git a/examples/advanced/src/gen/clients/axios/petService/deletePet.ts b/examples/advanced/src/gen/clients/axios/petService/deletePet.ts index 245a1718a..6352a470a 100644 --- a/examples/advanced/src/gen/clients/axios/petService/deletePet.ts +++ b/examples/advanced/src/gen/clients/axios/petService/deletePet.ts @@ -7,12 +7,12 @@ import type { DeletePetMutationResponse, DeletePetPathParams, DeletePetHeaderPar * @summary Deletes a pet * @link /pet/:petId */ -export async function deletePet( +export async function deletePet( { petId }: DeletePetPathParams, headers?: DeletePetHeaderParams, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'delete', url: `/pet/${petId}`, headers: { ...headers, ...options.headers }, diff --git a/examples/advanced/src/gen/clients/axios/petService/findPetsByStatus.ts b/examples/advanced/src/gen/clients/axios/petService/findPetsByStatus.ts index dc4df7511..32a4e0d83 100644 --- a/examples/advanced/src/gen/clients/axios/petService/findPetsByStatus.ts +++ b/examples/advanced/src/gen/clients/axios/petService/findPetsByStatus.ts @@ -7,11 +7,11 @@ import type { FindPetsByStatusQueryResponse, FindPetsByStatusQueryParams } from * @summary Finds Pets by status * @link /pet/findByStatus */ -export async function findPetsByStatus( +export async function findPetsByStatus( params?: FindPetsByStatusQueryParams, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'get', url: `/pet/findByStatus`, params, diff --git a/examples/advanced/src/gen/clients/axios/petService/findPetsByTags.ts b/examples/advanced/src/gen/clients/axios/petService/findPetsByTags.ts index 1729a06e8..b07e12ab6 100644 --- a/examples/advanced/src/gen/clients/axios/petService/findPetsByTags.ts +++ b/examples/advanced/src/gen/clients/axios/petService/findPetsByTags.ts @@ -7,12 +7,12 @@ import type { FindPetsByTagsQueryResponse, FindPetsByTagsQueryParams, FindPetsBy * @summary Finds Pets by tags * @link /pet/findByTags */ -export async function findPetsByTags( +export async function findPetsByTags( headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'get', url: `/pet/findByTags`, params, diff --git a/examples/advanced/src/gen/clients/axios/petService/getPetById.ts b/examples/advanced/src/gen/clients/axios/petService/getPetById.ts index 298d3c1df..9f56fe05e 100644 --- a/examples/advanced/src/gen/clients/axios/petService/getPetById.ts +++ b/examples/advanced/src/gen/clients/axios/petService/getPetById.ts @@ -7,11 +7,11 @@ import type { GetPetByIdQueryResponse, GetPetByIdPathParams } from '../../../mod * @summary Find pet by ID * @link /pet/:petId */ -export async function getPetById( +export async function getPetById( { petId }: GetPetByIdPathParams, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'get', url: `/pet/${petId}`, ...options, diff --git a/examples/advanced/src/gen/clients/axios/petService/updatePet.ts b/examples/advanced/src/gen/clients/axios/petService/updatePet.ts index 943b5758c..b9f18baa1 100644 --- a/examples/advanced/src/gen/clients/axios/petService/updatePet.ts +++ b/examples/advanced/src/gen/clients/axios/petService/updatePet.ts @@ -7,11 +7,11 @@ import type { UpdatePetMutationRequest, UpdatePetMutationResponse } from '../../ * @summary Update an existing pet * @link /pet */ -export async function updatePet( - data: TVariables, +export async function updatePet( + data: UpdatePetMutationRequest, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'put', url: `/pet`, data, diff --git a/examples/advanced/src/gen/clients/axios/petService/updatePetWithForm.ts b/examples/advanced/src/gen/clients/axios/petService/updatePetWithForm.ts index ed7869d7d..a8370519e 100644 --- a/examples/advanced/src/gen/clients/axios/petService/updatePetWithForm.ts +++ b/examples/advanced/src/gen/clients/axios/petService/updatePetWithForm.ts @@ -10,12 +10,12 @@ import type { * @summary Updates a pet in the store with form data * @link /pet/:petId */ -export async function updatePetWithForm( +export async function updatePetWithForm( { petId }: UpdatePetWithFormPathParams, params?: UpdatePetWithFormQueryParams, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'post', url: `/pet/${petId}`, params, diff --git a/examples/advanced/src/gen/clients/axios/petService/uploadFile.ts b/examples/advanced/src/gen/clients/axios/petService/uploadFile.ts index b556ca242..d9a177645 100644 --- a/examples/advanced/src/gen/clients/axios/petService/uploadFile.ts +++ b/examples/advanced/src/gen/clients/axios/petService/uploadFile.ts @@ -11,13 +11,13 @@ import type { * @summary uploads an image * @link /pet/:petId/uploadImage */ -export async function uploadFile( +export async function uploadFile( { petId }: UploadFilePathParams, - data?: TVariables, + data?: UploadFileMutationRequest, params?: UploadFileQueryParams, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'post', url: `/pet/${petId}/uploadImage`, params, diff --git a/examples/advanced/src/gen/clients/axios/petsService/createPets.ts b/examples/advanced/src/gen/clients/axios/petsService/createPets.ts index 89f3a1018..b7099672a 100644 --- a/examples/advanced/src/gen/clients/axios/petsService/createPets.ts +++ b/examples/advanced/src/gen/clients/axios/petsService/createPets.ts @@ -12,14 +12,14 @@ import type { * @summary Create a pet * @link /pets/:uuid */ -export async function createPets( +export async function createPets( { uuid }: CreatePetsPathParams, - data: TVariables, + data: CreatePetsMutationRequest, headers: CreatePetsHeaderParams, params?: CreatePetsQueryParams, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'post', url: `/pets/${uuid}`, params, diff --git a/examples/advanced/src/gen/clients/axios/userService/createUser.ts b/examples/advanced/src/gen/clients/axios/userService/createUser.ts index 9f1a1432f..49224b561 100644 --- a/examples/advanced/src/gen/clients/axios/userService/createUser.ts +++ b/examples/advanced/src/gen/clients/axios/userService/createUser.ts @@ -7,11 +7,11 @@ import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../. * @summary Create user * @link /user */ -export async function createUser( - data?: TVariables, +export async function createUser( + data?: CreateUserMutationRequest, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'post', url: `/user`, data, diff --git a/examples/advanced/src/gen/clients/axios/userService/createUsersWithListInput.ts b/examples/advanced/src/gen/clients/axios/userService/createUsersWithListInput.ts index 1730f5b74..318b33dc4 100644 --- a/examples/advanced/src/gen/clients/axios/userService/createUsersWithListInput.ts +++ b/examples/advanced/src/gen/clients/axios/userService/createUsersWithListInput.ts @@ -10,11 +10,11 @@ import type { * @summary Creates list of users with given input array * @link /user/createWithList */ -export async function createUsersWithListInput( - data?: TVariables, +export async function createUsersWithListInput( + data?: CreateUsersWithListInputMutationRequest, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'post', url: `/user/createWithList`, data, diff --git a/examples/advanced/src/gen/clients/axios/userService/deleteUser.ts b/examples/advanced/src/gen/clients/axios/userService/deleteUser.ts index 7b054fd3c..c10ef3c64 100644 --- a/examples/advanced/src/gen/clients/axios/userService/deleteUser.ts +++ b/examples/advanced/src/gen/clients/axios/userService/deleteUser.ts @@ -7,11 +7,11 @@ import type { DeleteUserMutationResponse, DeleteUserPathParams } from '../../../ * @summary Delete user * @link /user/:username */ -export async function deleteUser( +export async function deleteUser( { username }: DeleteUserPathParams, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'delete', url: `/user/${username}`, ...options, diff --git a/examples/advanced/src/gen/clients/axios/userService/getUserByName.ts b/examples/advanced/src/gen/clients/axios/userService/getUserByName.ts index cf8652868..e9654dd14 100644 --- a/examples/advanced/src/gen/clients/axios/userService/getUserByName.ts +++ b/examples/advanced/src/gen/clients/axios/userService/getUserByName.ts @@ -6,11 +6,11 @@ import type { GetUserByNameQueryResponse, GetUserByNamePathParams } from '../../ * @summary Get user by user name * @link /user/:username */ -export async function getUserByName( +export async function getUserByName( { username }: GetUserByNamePathParams, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'get', url: `/user/${username}`, ...options, diff --git a/examples/advanced/src/gen/clients/axios/userService/loginUser.ts b/examples/advanced/src/gen/clients/axios/userService/loginUser.ts index 40bdf888d..e2d1cddcf 100644 --- a/examples/advanced/src/gen/clients/axios/userService/loginUser.ts +++ b/examples/advanced/src/gen/clients/axios/userService/loginUser.ts @@ -6,11 +6,11 @@ import type { LoginUserQueryResponse, LoginUserQueryParams } from '../../../mode * @summary Logs user into the system * @link /user/login */ -export async function loginUser( +export async function loginUser( params?: LoginUserQueryParams, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'get', url: `/user/login`, params, diff --git a/examples/advanced/src/gen/clients/axios/userService/logoutUser.ts b/examples/advanced/src/gen/clients/axios/userService/logoutUser.ts index 96e0375de..d92d074ae 100644 --- a/examples/advanced/src/gen/clients/axios/userService/logoutUser.ts +++ b/examples/advanced/src/gen/clients/axios/userService/logoutUser.ts @@ -6,8 +6,8 @@ import type { LogoutUserQueryResponse } from '../../../models/ts/userController/ * @summary Logs out current logged in user session * @link /user/logout */ -export async function logoutUser(options: Partial[0]> = {}): Promise> { - return client({ +export async function logoutUser(options: Partial[0]> = {}): Promise> { + return client({ method: 'get', url: `/user/logout`, ...options, diff --git a/examples/advanced/src/gen/clients/axios/userService/updateUser.ts b/examples/advanced/src/gen/clients/axios/userService/updateUser.ts index f5b28c078..44ed2db99 100644 --- a/examples/advanced/src/gen/clients/axios/userService/updateUser.ts +++ b/examples/advanced/src/gen/clients/axios/userService/updateUser.ts @@ -7,12 +7,12 @@ import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserP * @summary Update user * @link /user/:username */ -export async function updateUser( +export async function updateUser( { username }: UpdateUserPathParams, - data?: TVariables, + data?: UpdateUserMutationRequest, options: Partial[0]> = {}, -): Promise> { - return client({ +): Promise> { + return client({ method: 'put', url: `/user/${username}`, data, diff --git a/examples/client/src/gen/clients/axios/petService/addPet.ts b/examples/client/src/gen/clients/axios/petService/addPet.ts index 0281cc40a..b015724de 100644 --- a/examples/client/src/gen/clients/axios/petService/addPet.ts +++ b/examples/client/src/gen/clients/axios/petService/addPet.ts @@ -7,11 +7,11 @@ import type { AddPetMutationRequest, AddPetMutationResponse } from '../../../mod * @summary Add a new pet to the store * @link /pet */ -export async function addPet( - data: TVariables, +export async function addPet( + data: AddPetMutationRequest, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'post', url: `/pet`, data, diff --git a/examples/client/src/gen/clients/axios/petService/deletePet.ts b/examples/client/src/gen/clients/axios/petService/deletePet.ts index 78773ad4c..83e0b54e6 100644 --- a/examples/client/src/gen/clients/axios/petService/deletePet.ts +++ b/examples/client/src/gen/clients/axios/petService/deletePet.ts @@ -7,12 +7,12 @@ import type { DeletePetMutationResponse, DeletePetPathParams, DeletePetHeaderPar * @summary Deletes a pet * @link /pet/:petId */ -export async function deletePet( +export async function deletePet( petId: DeletePetPathParams['petId'], headers?: DeletePetHeaderParams, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'delete', url: `/pet/${petId}`, headers: { ...headers, ...options.headers }, diff --git a/examples/client/src/gen/clients/axios/petService/findPetsByStatus.ts b/examples/client/src/gen/clients/axios/petService/findPetsByStatus.ts index 26831e0a8..f86dcd76c 100644 --- a/examples/client/src/gen/clients/axios/petService/findPetsByStatus.ts +++ b/examples/client/src/gen/clients/axios/petService/findPetsByStatus.ts @@ -7,11 +7,11 @@ import type { FindPetsByStatusQueryResponse, FindPetsByStatusQueryParams } from * @summary Finds Pets by status * @link /pet/findByStatus */ -export async function findPetsByStatus( +export async function findPetsByStatus( params?: FindPetsByStatusQueryParams, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'get', url: `/pet/findByStatus`, params, diff --git a/examples/client/src/gen/clients/axios/petService/findPetsByTags.ts b/examples/client/src/gen/clients/axios/petService/findPetsByTags.ts index 5acc83b54..8e98ddca8 100644 --- a/examples/client/src/gen/clients/axios/petService/findPetsByTags.ts +++ b/examples/client/src/gen/clients/axios/petService/findPetsByTags.ts @@ -7,12 +7,12 @@ import type { FindPetsByTagsQueryResponse, FindPetsByTagsQueryParams, FindPetsBy * @summary Finds Pets by tags * @link /pet/findByTags */ -export async function findPetsByTags( +export async function findPetsByTags( headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'get', url: `/pet/findByTags`, params, diff --git a/examples/client/src/gen/clients/axios/petService/getPetById.ts b/examples/client/src/gen/clients/axios/petService/getPetById.ts index c15ef61da..f60937a0c 100644 --- a/examples/client/src/gen/clients/axios/petService/getPetById.ts +++ b/examples/client/src/gen/clients/axios/petService/getPetById.ts @@ -7,11 +7,11 @@ import type { GetPetByIdQueryResponse, GetPetByIdPathParams } from '../../../mod * @summary Find pet by ID * @link /pet/:petId */ -export async function getPetById( +export async function getPetById( petId: GetPetByIdPathParams['petId'], options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'get', url: `/pet/${petId}`, ...options, diff --git a/examples/client/src/gen/clients/axios/petService/updatePet.ts b/examples/client/src/gen/clients/axios/petService/updatePet.ts index bddaf9b77..7fc870112 100644 --- a/examples/client/src/gen/clients/axios/petService/updatePet.ts +++ b/examples/client/src/gen/clients/axios/petService/updatePet.ts @@ -7,11 +7,11 @@ import type { UpdatePetMutationRequest, UpdatePetMutationResponse } from '../../ * @summary Update an existing pet * @link /pet */ -export async function updatePet( - data: TVariables, +export async function updatePet( + data: UpdatePetMutationRequest, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'put', url: `/pet`, data, diff --git a/examples/client/src/gen/clients/axios/petService/updatePetWithForm.ts b/examples/client/src/gen/clients/axios/petService/updatePetWithForm.ts index 082c4d70c..ad49fc7f7 100644 --- a/examples/client/src/gen/clients/axios/petService/updatePetWithForm.ts +++ b/examples/client/src/gen/clients/axios/petService/updatePetWithForm.ts @@ -10,12 +10,12 @@ import type { * @summary Updates a pet in the store with form data * @link /pet/:petId */ -export async function updatePetWithForm( +export async function updatePetWithForm( petId: UpdatePetWithFormPathParams['petId'], params?: UpdatePetWithFormQueryParams, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'post', url: `/pet/${petId}`, params, diff --git a/examples/client/src/gen/clients/axios/petService/uploadFile.ts b/examples/client/src/gen/clients/axios/petService/uploadFile.ts index f13b380d5..09f8e0745 100644 --- a/examples/client/src/gen/clients/axios/petService/uploadFile.ts +++ b/examples/client/src/gen/clients/axios/petService/uploadFile.ts @@ -11,13 +11,13 @@ import type { * @summary uploads an image * @link /pet/:petId/uploadImage */ -export async function uploadFile( +export async function uploadFile( petId: UploadFilePathParams['petId'], - data?: TVariables, + data?: UploadFileMutationRequest, params?: UploadFileQueryParams, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'post', url: `/pet/${petId}/uploadImage`, params, diff --git a/examples/client/src/gen/clients/axios/petsService/createPets.ts b/examples/client/src/gen/clients/axios/petsService/createPets.ts index ce210e5c8..f86611461 100644 --- a/examples/client/src/gen/clients/axios/petsService/createPets.ts +++ b/examples/client/src/gen/clients/axios/petsService/createPets.ts @@ -12,14 +12,14 @@ import type { * @summary Create a pet * @link /pets/:uuid */ -export async function createPets( +export async function createPets( uuid: CreatePetsPathParams['uuid'], - data: TVariables, + data: CreatePetsMutationRequest, headers: CreatePetsHeaderParams, params?: CreatePetsQueryParams, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'post', url: `/pets/${uuid}`, params, diff --git a/examples/client/src/gen/clients/axios/userService/createUser.ts b/examples/client/src/gen/clients/axios/userService/createUser.ts index a16919563..dd0f37df0 100644 --- a/examples/client/src/gen/clients/axios/userService/createUser.ts +++ b/examples/client/src/gen/clients/axios/userService/createUser.ts @@ -7,11 +7,11 @@ import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../. * @summary Create user * @link /user */ -export async function createUser( - data?: TVariables, +export async function createUser( + data?: CreateUserMutationRequest, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'post', url: `/user`, data, diff --git a/examples/client/src/gen/clients/axios/userService/createUsersWithListInput.ts b/examples/client/src/gen/clients/axios/userService/createUsersWithListInput.ts index cf69a376d..917d44387 100644 --- a/examples/client/src/gen/clients/axios/userService/createUsersWithListInput.ts +++ b/examples/client/src/gen/clients/axios/userService/createUsersWithListInput.ts @@ -10,11 +10,11 @@ import type { * @summary Creates list of users with given input array * @link /user/createWithList */ -export async function createUsersWithListInput( - data?: TVariables, +export async function createUsersWithListInput( + data?: CreateUsersWithListInputMutationRequest, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'post', url: `/user/createWithList`, data, diff --git a/examples/client/src/gen/clients/axios/userService/deleteUser.ts b/examples/client/src/gen/clients/axios/userService/deleteUser.ts index 1fd85b5f7..8df573da7 100644 --- a/examples/client/src/gen/clients/axios/userService/deleteUser.ts +++ b/examples/client/src/gen/clients/axios/userService/deleteUser.ts @@ -7,11 +7,11 @@ import type { DeleteUserMutationResponse, DeleteUserPathParams } from '../../../ * @summary Delete user * @link /user/:username */ -export async function deleteUser( +export async function deleteUser( username: DeleteUserPathParams['username'], options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'delete', url: `/user/${username}`, ...options, diff --git a/examples/client/src/gen/clients/axios/userService/getUserByName.ts b/examples/client/src/gen/clients/axios/userService/getUserByName.ts index 70791c301..374efcd2a 100644 --- a/examples/client/src/gen/clients/axios/userService/getUserByName.ts +++ b/examples/client/src/gen/clients/axios/userService/getUserByName.ts @@ -6,11 +6,11 @@ import type { GetUserByNameQueryResponse, GetUserByNamePathParams } from '../../ * @summary Get user by user name * @link /user/:username */ -export async function getUserByName( +export async function getUserByName( username: GetUserByNamePathParams['username'], options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'get', url: `/user/${username}`, ...options, diff --git a/examples/client/src/gen/clients/axios/userService/loginUser.ts b/examples/client/src/gen/clients/axios/userService/loginUser.ts index c67386564..ca8139696 100644 --- a/examples/client/src/gen/clients/axios/userService/loginUser.ts +++ b/examples/client/src/gen/clients/axios/userService/loginUser.ts @@ -6,11 +6,11 @@ import type { LoginUserQueryResponse, LoginUserQueryParams } from '../../../mode * @summary Logs user into the system * @link /user/login */ -export async function loginUser( +export async function loginUser( params?: LoginUserQueryParams, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'get', url: `/user/login`, params, diff --git a/examples/client/src/gen/clients/axios/userService/logoutUser.ts b/examples/client/src/gen/clients/axios/userService/logoutUser.ts index e5dc557bf..f30805099 100644 --- a/examples/client/src/gen/clients/axios/userService/logoutUser.ts +++ b/examples/client/src/gen/clients/axios/userService/logoutUser.ts @@ -6,8 +6,8 @@ import type { LogoutUserQueryResponse } from '../../../models/ts/userController/ * @summary Logs out current logged in user session * @link /user/logout */ -export async function logoutUser(options: Partial[0]> = {}): Promise['data']> { - const { data: resData } = await client({ +export async function logoutUser(options: Partial[0]> = {}): Promise['data']> { + const { data: resData } = await client({ method: 'get', url: `/user/logout`, ...options, diff --git a/examples/client/src/gen/clients/axios/userService/updateUser.ts b/examples/client/src/gen/clients/axios/userService/updateUser.ts index a41f5f31b..a231e82c2 100644 --- a/examples/client/src/gen/clients/axios/userService/updateUser.ts +++ b/examples/client/src/gen/clients/axios/userService/updateUser.ts @@ -7,12 +7,12 @@ import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserP * @summary Update user * @link /user/:username */ -export async function updateUser( +export async function updateUser( username: UpdateUserPathParams['username'], - data?: TVariables, + data?: UpdateUserMutationRequest, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'put', url: `/user/${username}`, data, diff --git a/packages/core/mocks/hellowWorld.js b/packages/core/mocks/hellowWorld.js index 9d79514e4..38424110f 100644 --- a/packages/core/mocks/hellowWorld.js +++ b/packages/core/mocks/hellowWorld.js @@ -1 +1 @@ -export const hallo = 'world' +export const hallo = 'world' \ No newline at end of file diff --git a/packages/swagger-client/src/builders/ClientBuilder.tsx b/packages/swagger-client/src/builders/ClientBuilder.tsx index ffd803f12..09c2f4efb 100644 --- a/packages/swagger-client/src/builders/ClientBuilder.tsx +++ b/packages/swagger-client/src/builders/ClientBuilder.tsx @@ -31,18 +31,12 @@ export class ClientBuilder extends OasBuilder { const clientGenerics = new FunctionParams() const params = new FunctionParams() - generics.add([ - { type: 'TData', default: schemas.response.name }, - { type: 'TVariables', default: schemas.request?.name, enabled: !!schemas.request?.name }, - ]) - - clientGenerics.add([{ type: 'TData' }, { type: 'TVariables', enabled: !!schemas.request?.name }]) - + clientGenerics.add([{ type: schemas.response.name }, { type: schemas.request?.name, enabled: !!schemas.request?.name }]) params.add([ ...getASTParams(schemas.pathParams, { typed: true, asObject: pathParamsType === 'object' }), { name: 'data', - type: 'TVariables', + type: schemas.request?.name, enabled: !!schemas.request?.name, required: !!schemas.request?.schema.required?.length, }, @@ -76,7 +70,7 @@ export class ClientBuilder extends OasBuilder { clientGenerics={clientGenerics.toString()} dataReturnType={dataReturnType} params={params.toString()} - returnType={dataReturnType === 'data' ? `ResponseConfig["data"]` : `ResponseConfig`} + returnType={dataReturnType === 'data' ? `ResponseConfig<${schemas.response.name}>["data"]` : `ResponseConfig<${schemas.response.name}>`} method={method} path={new URLPath(operation.path)} withParams={!!schemas.queryParams?.name} diff --git a/packages/swagger-client/src/generators/__snapshots__/OperationGenerator.test.ts.snap b/packages/swagger-client/src/generators/__snapshots__/OperationGenerator.test.ts.snap index 5d18a3ffc..da1b24829 100644 --- a/packages/swagger-client/src/generators/__snapshots__/OperationGenerator.test.ts.snap +++ b/packages/swagger-client/src/generators/__snapshots__/OperationGenerator.test.ts.snap @@ -5,12 +5,12 @@ exports[`OperationGenerator > [GET] should generate code based on a pathParamsTy * @summary Info for a specific pet * @link /pets/:pet_id */ -export async function showPetById( +export async function showPetById( petId: ShowPetByIdPathParams['pet_id'], testId: ShowPetByIdPathParams['testId'], options: Partial[0]> = {}, -): Promise> { - const { data: resData } = await client({ +): Promise> { + const { data: resData } = await client({ method: 'get', url: \`/pets/\${petId}\`, ...options, @@ -26,11 +26,11 @@ exports[`OperationGenerator > [GET] should generate code based on a pathParamsTy * @summary Info for a specific pet * @link /pets/:pet_id */ -export async function showPetById( +export async function showPetById( { petId, testId }: ShowPetByIdPathParams, options: Partial[0]> = {}, -): Promise['data']> { - const { data: resData } = await client({ +): Promise['data']> { + const { data: resData } = await client({ method: 'get', url: \`/pets/\${petId}\`, ...options, diff --git a/packages/swagger-ts/src/generators/TypeGenerator.test.ts b/packages/swagger-ts/src/generators/TypeGenerator.test.ts index 1883ecd84..76b3faeea 100644 --- a/packages/swagger-ts/src/generators/TypeGenerator.test.ts +++ b/packages/swagger-ts/src/generators/TypeGenerator.test.ts @@ -184,7 +184,7 @@ describe('TypeGenerator with refs', () => { }) describe('TypeGenerator with discriminators', () => { - const path = pathParser.resolve(__dirname, "../../mocks/discriminator.yaml") + const path = pathParser.resolve(__dirname, '../../mocks/discriminator.yaml') test('PetStore defined as array with type union', async () => { const oas = await oasPathParser(path) @@ -239,6 +239,5 @@ describe('TypeGenerator with discriminators', () => { const dog_output = print(dog, undefined) expect(dog_output).toBeDefined() expect(dog_output).toMatchSnapshot() - }) - + }) }) diff --git a/packages/swagger-ts/src/generators/TypeGenerator.ts b/packages/swagger-ts/src/generators/TypeGenerator.ts index f8d2a6929..3bd00f51e 100644 --- a/packages/swagger-ts/src/generators/TypeGenerator.ts +++ b/packages/swagger-ts/src/generators/TypeGenerator.ts @@ -379,8 +379,8 @@ export class TypeGenerator extends SchemaGenerator