Skip to content

Commit

Permalink
Merge pull request #512 from WickyNilliams/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle authored Oct 19, 2023
2 parents a435434 + 2024426 commit 5ab37b0
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 32 deletions.
16 changes: 12 additions & 4 deletions docs/plugins/swagger-client/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ With the Swagger client plugin you can create [Axios](https://axios-http.com/doc

::: code-group

```shell [bun <img src="/feature/bun.svg"/>]
```shell [bun <img src="/feature/bun.svg"/>]
bun add @kubb/swagger-client
```

```shell [pnpm <img src="/feature/pnpm.svg"/>]
```shell [pnpm <img src="/feature/pnpm.svg"/>]
pnpm add @kubb/swagger-client
```

```shell [npm <img src="/feature/npm.svg"/>]
```shell [npm <img src="/feature/npm.svg"/>]
npm install @kubb/swagger-client
```

```shell [yarn <img src="/feature/yarn.svg"/>]
```shell [yarn <img src="/feature/yarn.svg"/>]
yarn add @kubb/swagger-client
```

Expand All @@ -50,18 +50,26 @@ Type: `'tag'` <br/>
Required: `true`

#### output
::: v-pre
Relative path to save the grouped clients.
`{{tag}}` will be replaced by the current tagName.
:::

::: v-pre
Type: `string` <br/>
Example: `clients/{{tag}}Controller` => `clients/PetController` <br/>
Default: `${output}/{{tag}}Controller`
:::

#### exportAs
::: v-pre
Name to be used for the `export * as {{exportAs}} from './`
:::

::: v-pre
Type: `string` <br/>
Default: `"{{tag}}Service"`
:::

### client <Badge type="danger" text="deprecated" />
Path to the client that will be used to do the API calls.
Expand Down
14 changes: 10 additions & 4 deletions docs/plugins/swagger-faker.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ With the Swagger Faker plugin you can use [Faker](https://fakerjs.dev/) to creat

::: code-group

```shell [bun <img src="/feature/bun.svg"/>]
```shell [bun <img src="/feature/bun.svg"/>]
bun add @kubb/swagger-faker
```

```shell [pnpm <img src="/feature/pnpm.svg"/>]
```shell [pnpm <img src="/feature/pnpm.svg"/>]
pnpm add @kubb/swagger-faker
```

```shell [npm <img src="/feature/npm.svg"/>]
```shell [npm <img src="/feature/npm.svg"/>]
npm install @kubb/swagger-faker
```

```shell [yarn <img src="/feature/yarn.svg"/>]
```shell [yarn <img src="/feature/yarn.svg"/>]
yarn add @kubb/swagger-faker
```

Expand All @@ -51,18 +51,24 @@ Type: `'tag'` <br/>
Required: `true`

#### output
::: v-pre
Relative path to save the grouped Faker mocks.
`{{tag}}` will be replaced by the current tagName.
:::

::: v-pre
Type: `string` <br/>
Example: `mocks/{{tag}}Controller` => `mocks/PetController` <br/>
Default: `${output}/{{tag}}Controller`
:::

#### exportAs
Name to be used for the `export * as {{exportAs}} from './`

::: v-pre
Type: `string` <br/>
Default: `"{{tag}}Mocks"`
:::

### skipBy
Array containing skipBy paramaters to exclude/skip tags/operations/methods/paths.
Expand Down
14 changes: 10 additions & 4 deletions docs/plugins/swagger-msw.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ With the MSW plugin you can use [MSW](https://mswjs.io/) to create API mocks bas

::: code-group

```shell [bun <img src="/feature/bun.svg"/>]
```shell [bun <img src="/feature/bun.svg"/>]
bun add @kubb/swagger-msw
```

```shell [pnpm <img src="/feature/pnpm.svg"/>]
```shell [pnpm <img src="/feature/pnpm.svg"/>]
pnpm add @kubb/swagger-msw
```

```shell [npm <img src="/feature/npm.svg"/>]
```shell [npm <img src="/feature/npm.svg"/>]
npm install @kubb/swagger-msw
```

```shell [yarn <img src="/feature/yarn.svg"/>]
```shell [yarn <img src="/feature/yarn.svg"/>]
yarn add @kubb/swagger-msw
```

Expand All @@ -51,18 +51,24 @@ Type: `'tag'` <br/>
Required: `true`

#### output
::: v-pre
Relative path to save the grouped MSW mocks.
`{{tag}}` will be replaced by the current tagName.
:::

::: v-pre
Type: `string` <br/>
Example: `mocks/{{tag}}Controller` => `mocks/PetController` <br/>
Default: `${output}/{{tag}}Controller`
:::

#### exportAs
Name to be used for the `export * as {{exportAs}} from './`

::: v-pre
Type: `string` <br/>
Default: `"{{tag}}Handlers"`
:::

### skipBy
Array containing skipBy paramaters to exclude/skip tags/operations/methods/paths.
Expand Down
16 changes: 12 additions & 4 deletions docs/plugins/swagger-swr.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ With the Swagger SWR plugin you can create [SWR hooks](https://swr.vercel.app/)

::: code-group

```shell [bun <img src="/feature/bun.svg"/>]
```shell [bun <img src="/feature/bun.svg"/>]
bun add @kubb/swagger-swr
```

```shell [pnpm <img src="/feature/pnpm.svg"/>]
```shell [pnpm <img src="/feature/pnpm.svg"/>]
pnpm add @kubb/swagger-swr
```

```shell [npm <img src="/feature/npm.svg"/>]
```shell [npm <img src="/feature/npm.svg"/>]
npm install @kubb/swagger-swr
```

```shell [yarn <img src="/feature/yarn.svg"/>]
```shell [yarn <img src="/feature/yarn.svg"/>]
yarn add @kubb/swagger-swr
```

Expand All @@ -49,18 +49,26 @@ Type: `'tag'` <br/>
Required: `true`

#### output
::: v-pre
Relative path to save the grouped SWR hooks.
`{{tag}}` will be replaced by the current tagName.
:::

::: v-pre
Type: `string` <br/>
Example: `hooks/{{tag}}Controller` => `hooks/PetController` <br/>
Default: `${output}/{{tag}}Controller`
:::

#### exportAs
::: v-pre
Name to be used for the `export * as {{exportAs}} from './`
:::

::: v-pre
Type: `string` <br/>
Default: `"{{tag}}SWRHooks"`
:::

### client <Badge type="danger" text="deprecated" />
Path to the client that will be used to do the API calls.
Expand Down
20 changes: 14 additions & 6 deletions docs/plugins/swagger-tanstack-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ outline: deep

# @kubb/swagger-tanstack-query

With the Swagger Tanstack Query plugin you can create:
With the Swagger Tanstack Query plugin you can create:
- [react-query](https://tanstack.com/query/latest/docs/react) hooks based on an operation in the Swagger file.
- [solid-query](https://tanstack.com/query/latest/docs/solid) primitives based on an operation in the Swagger file.
- [svelte-query](https://tanstack.com/query/latest/docs/svelte) primitives based on an operation in the Swagger file.
Expand All @@ -18,19 +18,19 @@ With the Swagger Tanstack Query plugin you can create:

::: code-group

```shell [bun <img src="/feature/bun.svg"/>]
```shell [bun <img src="/feature/bun.svg"/>]
bun add @kubb/swagger-tanstack-query
```

```shell [pnpm <img src="/feature/pnpm.svg"/>]
```shell [pnpm <img src="/feature/pnpm.svg"/>]
pnpm add @kubb/swagger-tanstack-query
```

```shell [npm <img src="/feature/npm.svg"/>]
```shell [npm <img src="/feature/npm.svg"/>]
npm install @kubb/swagger-tanstack-query
```

```shell [yarn <img src="/feature/yarn.svg"/>]
```shell [yarn <img src="/feature/yarn.svg"/>]
yarn add @kubb/swagger-tanstack-query
```

Expand All @@ -55,18 +55,26 @@ Type: `'tag'` <br/>
Required: `true`

#### output
::: v-pre
Relative path to save the grouped @tanstack/query hooks.
`{{tag}}` will be replaced by the current tagName.
:::

::: v-pre
Type: `string` <br/>
Example: `hooks/{{tag}}Controller` => `hooks/PetController` <br/>
Default: `${output}/{{tag}}Controller`
:::

#### exportAs
::: v-pre
Name to be used for the `export * as {{exportAs}} from './`
:::

::: v-pre
Type: `string` <br/>
Default: `"{{tag}}Hooks"`
:::

### client <Badge type="danger" text="deprecated" />
Path to the client that will be used to do the API calls.
Expand Down Expand Up @@ -102,7 +110,7 @@ Type: `'react' | 'solid' | 'svelte' | 'vue'` <br/>
Default: `"react"`

### infinite
When set, an infiniteQuery is getting created, example:
When set, an infiniteQuery is getting created, example:
```typescript
{
output: './clients/hooks',
Expand Down
14 changes: 9 additions & 5 deletions docs/plugins/swagger-ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ With the Swagger TypeScript plugin you can create [TypeScript](https://www.types

::: code-group

```shell [bun <img src="/feature/bun.svg"/>]
```shell [bun <img src="/feature/bun.svg"/>]
bun add @kubb/swagger-ts
```

```shell [pnpm <img src="/feature/pnpm.svg"/>]
```shell [pnpm <img src="/feature/pnpm.svg"/>]
pnpm add @kubb/swagger-ts
```

```shell [npm <img src="/feature/npm.svg"/>]
```shell [npm <img src="/feature/npm.svg"/>]
npm install @kubb/swagger-ts
```

```shell [yarn <img src="/feature/yarn.svg"/>]
```shell [yarn <img src="/feature/yarn.svg"/>]
yarn add @kubb/swagger-ts
```

Expand All @@ -49,12 +49,16 @@ Type: `'tag'` <br/>
Required: `true`

#### output
::: v-pre
Relative path to save the grouped TypeScript Types.
`{{tag}}` will be replaced by the current tagName.
:::

::: v-pre
Type: `string` <br/>
Example: `models/{{tag}}Controller` => `models/PetController` <br/>
Default: `${output}/{{tag}}Controller`
:::

### enumType
Choose to use `enum` or `as const` for enums. <br/>
Expand All @@ -74,7 +78,7 @@ date: string
```

```typescript ['date']
date: Date
date: Date
```
:::

Expand Down
17 changes: 12 additions & 5 deletions docs/plugins/swagger-zod.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ With the Swagger Zod plugin you can use [Zod](https://zod.dev/) to validate your

::: code-group

```shell [bun <img src="/feature/bun.svg"/>]
```shell [bun <img src="/feature/bun.svg"/>]
bun add @kubb/swagger-zod
```

```shell [pnpm <img src="/feature/pnpm.svg"/>]
```shell [pnpm <img src="/feature/pnpm.svg"/>]
pnpm add @kubb/swagger-zod
```

```shell [npm <img src="/feature/npm.svg"/>]
```shell [npm <img src="/feature/npm.svg"/>]
npm install @kubb/swagger-zod
```

```shell [yarn <img src="/feature/yarn.svg"/>]
```shell [yarn <img src="/feature/yarn.svg"/>]
yarn add @kubb/swagger-zod
```

Expand All @@ -50,19 +50,26 @@ Type: `'tag'` <br/>
Required: `true`

#### output
::: v-pre
Relative path to save the grouped Zod schemas.
`{{tag}}` will be replaced by the current tagName.
:::

::: v-pre
Type: `string` <br/>
Example: `zod/{{tag}}Controller` => `zod/PetController` <br/>
Default: `${output}/{{tag}}Controller`
:::

#### exportAs
::: v-pre
Name to be used for the `export * as {{exportAs}} from './`
:::

::: v-pre
Type: `string` <br/>
Default: `"{{tag}}Schemas"`

:::

### skipBy
Array containing skipBy paramaters to exclude/skip tags/operations/methods/paths.
Expand Down

1 comment on commit 5ab37b0

@vercel
Copy link

@vercel vercel bot commented on 5ab37b0 Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kubb – ./

www.kubb.dev
kubb.dev
kubb-kubb.vercel.app
kubb-git-main-kubb.vercel.app

Please sign in to comment.