We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kubb
3.3.4
None
kubb.config.ts
import { defineConfig } from '@kubb/core'; import { pluginClient } from '@kubb/plugin-client'; import { pluginOas } from '@kubb/plugin-oas'; import { pluginReactQuery } from '@kubb/plugin-react-query'; import { pluginTs } from '@kubb/plugin-ts'; export default defineConfig({ input: { path: './schema.yaml', }, output: { clean: true, path: './src', }, plugins: [ pluginOas({ validate: true, // @ts-ignore output: false, }), pluginTs({ output: { path: './types', banner: ` /** * Generated by kubb. * Do not edit manually. * Shape API */ `, }, exclude: [], enumType: 'asConst', enumSuffix: 'Enum', dateType: 'string', unknownType: 'unknown', optionalType: 'questionToken', oasType: false, transformers: { name: (name, type) => { if (type === 'file') return `${name[0].toLowerCase() + name.slice(1)}Schema`; return `${name}Schema`; }, }, }), pluginClient({ importPath: '../../client.kubb.ts', output: { path: './api/index.ts', barrelType: 'propagate', banner: ` /** * Generated by kubb. * Do not edit manually. * Shape API */ `, }, dataReturnType: 'data', }), pluginReactQuery({ client: { importPath: '../../client.kubb.ts', dataReturnType: 'data', }, output: { path: './hooks/index.ts', banner: ` /** * Generated by kubb. * Do not edit manually. * Shape API */ `, }, paramsCasing: 'camelcase', suspense: {}, }), ], });
No response
@tanstack-query
MSW
React
Vue
When the error can be multiple types, the error comes as uknown. Here is an example of the a generated hook and the error when using the hook:
export function useGetApiProjectsProjectIdIssuesIssueId< TData = GetApiProjectsProjectIdIssuesIssueIdQueryResponseSchema, TQueryData = GetApiProjectsProjectIdIssuesIssueIdQueryResponseSchema, TQueryKey extends QueryKey = GetApiProjectsProjectIdIssuesIssueIdQueryKey, >( projectId: GetApiProjectsProjectIdIssuesIssueIdPathParamsSchema['project_id'], issueId: GetApiProjectsProjectIdIssuesIssueIdPathParamsSchema['issue_id'], options: { query?: Partial< QueryObserverOptions< GetApiProjectsProjectIdIssuesIssueIdQueryResponseSchema, GetApiProjectsProjectIdIssuesIssueId401Schema | GetApiProjectsProjectIdIssuesIssueId403Schema | GetApiProjectsProjectIdIssuesIssueId404Schema, TData, TQueryData, TQueryKey > > client?: Partial<RequestConfig> } = {}, ) { const { query: queryOptions, client: config = {} } = options ?? {} const queryKey = queryOptions?.queryKey ?? getApiProjectsProjectIdIssuesIssueIdQueryKey(projectId, issueId) const query = useQuery({ ...(getApiProjectsProjectIdIssuesIssueIdQueryOptions(projectId, issueId, config) as unknown as QueryObserverOptions), queryKey, ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>), }) as UseQueryResult< TData, GetApiProjectsProjectIdIssuesIssueId401Schema | GetApiProjectsProjectIdIssuesIssueId403Schema | GetApiProjectsProjectIdIssuesIssueId404Schema > & { queryKey: TQueryKey } query.queryKey = queryKey as TQueryKey return query }
Every time
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of
kubb
is running?3.3.4
What kind of platform do you use?
None
How does your
kubb.config.ts
config look likeSwagger/OpenAPI file?
No response
What version of external packages are you using(
@tanstack-query
,MSW
,React
,Vue
, ...)No response
What steps can reproduce the bug?
When the error can be multiple types, the error comes as uknown. Here is an example of the a generated hook and the error when using the hook:
How often does this bug happen?
Every time
What is the expected behavior?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: