@kubb/plugin-client
Version:
API client generator plugin for Kubb, creating type-safe HTTP clients (Axios, Fetch) from OpenAPI specifications for making API requests.
29 lines (25 loc) • 898 B
text/typescript
/* eslint-disable no-alert, no-console */
/**
* Generated by Kubb (https://kubb.dev/).
* Do not edit manually.
*/
import fetch from 'axios'
import type { RequestConfig, ResponseErrorConfig } from 'axios'
export function getFindPetsByTagsUrl() {
return `/pet/findByTags` as const
}
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
export async function findPetsByTags(params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> & { client?: typeof fetch } = {}) {
const { client: request = fetch, ...requestConfig } = config
const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
method: 'GET',
url: getFindPetsByTagsUrl().toString(),
params,
...requestConfig,
})
return res.data
}