Skip to content

Changelog

3.3.4

  • plugin-ts: minLength, maxLength, pattern as part of the jsdocs
  • plugin-client: baseURL could be undefined, do not throw error if that is the case

3.3.3

  • react: Use of @kubb/react as importSource for jsx(React 17, React 18, React 19 could be used next to Kubb)
  • cli: Use of @kubb/react as importSource for jsx(React 17, React 18, React 19 could be used next to Kubb)

3.3.2

  • react: Support div and other basic elements to be returned by @kubb/react

3.3.1

  • plugin-zod: Use of tozod util to create schema based on a type

3.3.0

  • plugin-client: client to use fetch or axios as HTTP client
  • plugin-zod: Use Regular expression literal instead of RegExp-contructor
  • plugin-ts: Switch between the use of type or interface when creating types

3.2.0

3.1.0

typescript
group: {
  type: 'path',
  name: ({ group }) => {
    const firstSegment = group.split('/')[1];
    return firstSegment;
  }
}
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 packages
  • plugin-oas: Applying required on fields inherited using allOf

3.0.12

3.0.11

  • core: Disabling output file extension
  • plugin-oas: Correct use of Jsdocs syntax for links
  • core: 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 option
  • core: Correct use of barrelType for single files

3.0.8

  • plugin-zod: Blob as z.instanceof(File) instead of string

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

3.0.2

3.0.1

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 files
  • plugin-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

3.0.0-beta.7

  • Upgrade external packages

3.0.0-beta.6

  • plugin-faker: Min/Max for type array to generate better faker.helpers.arrayElements functionality

3.0.0-beta.5

  • plugin-zod: Discard optional() if there is a default() to ensure the output type is not T | 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 using group(no need to specify group.exportAs)
  • plugin-core: Removal of group.exportAs
  • plugin-core: Removal of group.output in favour of group.name(no need to specify the output/root)
kubb.config.ts
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 of output.extName in favour of output.extension
  • plugin-core: Removal of exportType in favour of barrelType

3.0.0-alpha.29

3.0.0-alpha.28

3.0.0-alpha.27

  • plugin-swr: Support for TypeScript strict mode
  • plugin-react-query: Support for TypeScript strict mode and use of data object for mutationFn: async(data: {})
  • plugin-svelte-query: Support for TypeScript strict mode and use of data object for mutationFn: async(data: {})
  • plugin-vue-query: Support for TypeScript strict mode and use of data object for mutationFn: async(data: {})
  • plugin-solid-query: Support for TypeScript strict mode and use of data object for mutationFn: 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

3.0.0-alpha.24

3.0.0-alpha.23

  • plugin-client: Use of uppercase for httpMethods, GET instead of get, POST instead of post, ...

3.0.0-alpha.22

  • plugin-faker: Use of faker.image.url() instead of faker.image.imageUrl()
  • plugin-zod: Enums should use z.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 of readonly for references($ref)
  • plugin-client: Use of type Error when no errors are set for an operation

3.0.0-alpha.21

  • plugin-zod: Use of x-nullable and nullable for additionalProperties.

3.0.0-alpha.20

  • Separate plugin/package for Solid-Query: @kubb/plugin-solid-query
kubb.config.ts
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
kubb.config.ts
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
kubb.config.ts
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
kubb.config.ts
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',
      },
    })
  ],
})

Released under the MIT License.