Changelog
3.1.0
plugin-msw
: Support dynamic and customizable data in handlers
typescript
findPetsByStatusHandler((info) => {
const { params } = info
if (params.someKey) {
return new Response(
JSON.stringify({ error: 'some error response' }),
{ status: 400 }
);
}
return new Response(
JSON.stringify({ newData: 'new data' }),
{ status: 200 }
);
})
3.0.14
core
: Upgrade packages
3.0.13
core
: Upgrade packagesplugin-oas
: Applying required on fields inherited using allOf
3.0.12
plugin-zod
: 2xx as part ofoperations.ts
3.0.11
core
: Disabling output file extensionplugin-oas
: Correct use of Jsdocs syntax for linkscore
: Respect casing of parameters
3.0.10
plugin-faker
:data
should have a higher priority than faker defaults generation
3.0.9
plugin-oas
: Allow nullable with default null optioncore
: Correct use ofbarrelType
for single files
3.0.8
plugin-zod
: Blob asz.instanceof(File)
instead ofstring
3.0.7
core
: Include single file exports in the main index.ts file.
3.0.6
plugin-oas
: Correct use of variables when a path/params contains _ or -core
:barrelType: 'propagate'
to make sure the core can still generate barrel files, even if the plugin will not have barrel files
3.0.5
react
: Better error logging + wider range for@kubb/react
peerDependency
3.0.4
- Upgrade external dependencies
3.0.3
plugin-ts
:@deprecated
jsdoc tag for schemas
3.0.2
plugin-react-query
: remove the requirement ofplugin-client
plugin-svelte-query
: remove the requirement ofplugin-client
plugin-vue-query
: remove the requirement ofplugin-client
plugin-solid-query
: remove the requirement ofplugin-client
3.0.1
plugin-faker
: Correct faker functions for uuid, pattern and emailplugin-react-query
: allow disablinguseQuery
plugin-react-query
: use ofInfiniteData
TypeScript helper for infiniteQueriesplugin-vue-query
: use ofInfiniteData
TypeScript helper for infiniteQueries
3.0.0-beta.12
plugin-react-query
: allow to disable the generation of useQuery or createQuery hooks.plugin-svelte-query
: allow to disable the generation of useQuery or createQuery hooks.plugin-vue-query
: allow to disable the generation of useQuery or createQuery hooks.plugin-solid-query
: allow to disable the generation of useQuery or createQuery hooks.plugin-swr
: allow to disable the generation of useQuery or createQuery hooks.
3.0.0-beta.11
plugin-ts
: enumType'enum'
without export type in barrel filesplugin-client
: Allows you to set a custom base url for all generated calls
3.0.0-beta.10
plugin-react-query
:paramsType
with options'inline'
and'object'
to have control over the amount of parameters when calling one of the generated functions.plugin-svelte-query
:paramsType
with options'inline'
and'object'
to have control over the amount of parameters when calling one of the generated functions.plugin-vue-query
:paramsType
with options'inline'
and'object'
to have control over the amount of parameters when calling one of the generated functions.plugin-solid-query
:paramsType
with options'inline'
and'object'
to have control over the amount of parameters when calling one of the generated functions.plugin-client
:paramsType
with options'inline'
and'object'
to have control over the amount of parameters when calling one of the generated functions.
3.0.0-beta.9
plugin-msw
:parser
option to disable faker generation'faker'
will use@kubb/plugin-faker
to generate the data for the response'data'
will use your custom data to generate the data for the response
plugin-msw
: Siblings for better AST manipulation
3.0.0-beta.8
plugin-zod
: Siblings for better AST manipulation
3.0.0-beta.7
- Upgrade external packages
3.0.0-beta.6
plugin-faker
: Min/Max for type array to generate betterfaker.helpers.arrayElements
functionality
3.0.0-beta.5
plugin-zod
: Discardoptional()
if there is adefault()
to ensure the output type is notT | undefined
3.0.0-beta.4
- Upgrade external packages
3.0.0-beta.3
plugin-zod
: Added coercion for specific types only
typescript
type coercion= boolean | { dates?: boolean; strings?: boolean; numbers?: boolean }
3.0.0-beta.2
- Upgrade external packages
3.0.0-beta.1
- Upgrade external packages
3.0.0-alpha.31
plugin-client
: Generate${tag}Service
controller file related to group x when usinggroup
(no need to specifygroup.exportAs
)plugin-core
: Removal ofgroup.exportAs
plugin-core
: Removal ofgroup.output
in favour ofgroup.name
(no need to specify the output/root)
typescript
import { defineConfig } from "@kubb/core"
import { pluginOas } from "@kubb/plugin-oas"
import { pluginTs } from "@kubb/plugin-ts"
import { pluginClient } from '@kubb/plugin-client'
export default defineConfig({
root: '.',
input: {
path: './petStore.yaml',
},
output: {
path: './src/gen',
clean: true,
},
plugins: [
pluginOas({ generators: [] }),
pluginClient({
output: {
path: './clients/axios',
},
// group: { type: 'tag', output: './clients/axios/{{tag}}Service' },
group: { type: 'tag', name: ({ group }) => `${group}Service` },
}),
],
})
3.0.0-alpha.30
plugin-core
: Removal ofoutput.extName
in favour ofoutput.extension
plugin-core
: Removal ofexportType
in favour ofbarrelType
3.0.0-alpha.29
plugin-react-query
: Support for cancellation of queries with the help ofsignal
plugin-svelte-query
: Support for cancellation of queries with the help ofsignal
plugin-vue-query
: Support for cancellation of queries with the help ofsignal
plugin-solid-query
: Support for cancellation of queries with the help ofsignal
plugin-react-query
: Use ofenabled
based on optional paramsplugin-svelte-query
: Use ofenabled
based on optional paramsplugin-vue-query
: Use ofenabled
based on optional paramsplugin-solid-query
: Use ofenabled
based on optional params
3.0.0-alpha.28
plugin-zod
: Respect order ofz.tuple
3.0.0-alpha.27
plugin-swr
: Support for TypeScriptstrict
modeplugin-react-query
: Support for TypeScriptstrict
mode and use of data object formutationFn: async(data: {})
plugin-svelte-query
: Support for TypeScriptstrict
mode and use of data object formutationFn: async(data: {})
plugin-vue-query
: Support for TypeScriptstrict
mode and use of data object formutationFn: async(data: {})
plugin-solid-query
: Support for TypeScriptstrict
mode and use of data object formutationFn: async(data: {})
3.0.0-alpha.26
plugin-swr
: Expose queryKey and mutationKey for the SWR plugin- 'generators' option for all plugins
3.0.0-alpha.25
plugin-react-query
: Use of MutationKeys foruseMutation
plugin-svelte-query
: Use of MutationKeys forcreateMutation
plugin-vue-query
: Use of MutationKeys foruseMutation
3.0.0-alpha.24
plugin-oas
: Support for discriminator
3.0.0-alpha.23
plugin-client
: Use of uppercase for httpMethods,GET
instead ofget
,POST
instead ofpost
, ...
3.0.0-alpha.22
plugin-faker
: Use offaker.image.url()
instead offaker.image.imageUrl()
plugin-zod
: Enums should usez.literal
when format is set to number, string or boolean
yaml
enum:
type: boolean
enum:
- true
- false
typescript
z.enum(["true", "false"])
z.union([z.literal(true), z.literal(false)])
plugin-ts
: Use ofreadonly
for references($ref)plugin-client
: Use of typeError
when no errors are set for an operation
3.0.0-alpha.21
plugin-zod
: Use ofx-nullable
andnullable
for additionalProperties.
3.0.0-alpha.20
- Separate plugin/package for Solid-Query:
@kubb/plugin-solid-query
typescript
import { defineConfig } from "@kubb/core"
import { pluginOas } from "@kubb/plugin-oas"
import { pluginTs } from "@kubb/plugin-ts"
import { pluginSolidQuery } from '@kubb/plugin-solid-query'
import { pluginTanstackQuery } from '@kubb/plugin-tanstack-query'
export default defineConfig({
root: '.',
input: {
path: './petStore.yaml',
},
output: {
path: './src/gen',
clean: true,
},
plugins: [
pluginOas({ generators: [] }),
pluginTs({
output: {
path: 'models',
},
}),
pluginSolidQuery({
output: {
path: './hooks',
},
})
],
})
- Separate plugin/package for Svelte-Query:
@kubb/plugin-svelte-query
typescript
import {defineConfig} from "@kubb/core"
import {pluginOas} from "@kubb/plugin-oas"
import {pluginTs} from "@kubb/plugin-ts"
import { pluginSvelteQuery } from '@kubb/plugin-svelte-query'
import { pluginTanstackQuery } from '@kubb/plugin-tanstack-query'
export default defineConfig({
root: '.',
input: {
path: './petStore.yaml',
},
output: {
path: './src/gen',
clean: true,
},
plugins: [
pluginOas({ generators: [] }),
pluginTs({
output: {
path: 'models',
},
}),
pluginSvelteQuery({
output: {
path: './hooks',
},
})
],
})
- Separate plugin/package for Vue-Query:
@kubb/plugin-vue-query
typescript
import {defineConfig} from "@kubb/core"
import {pluginOas} from "@kubb/plugin-oas"
import {pluginTs} from "@kubb/plugin-ts"
import { pluginVueQuery } from '@kubb/plugin-vue-query'
import { pluginTanstackQuery } from '@kubb/plugin-tanstack-query'
export default defineConfig({
root: '.',
input: {
path: './petStore.yaml',
},
output: {
path: './src/gen',
clean: true,
},
plugins: [
pluginOas({ generators: [] }),
pluginTs({
output: {
path: 'models',
},
}),
pluginVueQuery({
output: {
path: './hooks',
},
})
],
})
3.0.0-alpha.16
- Separate plugin/package for React-Query:
@kubb/plugin-react-query
typescript
import {defineConfig} from "@kubb/core"
import {pluginOas} from "@kubb/plugin-oas"
import {pluginTs} from "@kubb/plugin-ts"
import { pluginReactQuery } from '@kubb/plugin-react-query'
import { pluginTanstackQuery } from '@kubb/plugin-tanstack-query'
export default defineConfig({
root: '.',
input: {
path: './petStore.yaml',
},
output: {
path: './src/gen',
clean: true,
},
plugins: [
pluginOas({ generators: [] }),
pluginTs({
output: {
path: 'models',
},
}),
pluginReactQuery({
output: {
path: './hooks',
},
})
],
})