Skip to content

Commit

Permalink
fix(docs): configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
enkot committed Nov 11, 2023
1 parent 73ae3a9 commit 55a6191
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
26 changes: 25 additions & 1 deletion docs/content/1.setup/2.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineNuxtConfig({

| **Key** | **Type** | **Default** | **Description** |
| ---------------------------- | ---------- | --------------------- | ---------------------------------------------------------------------------------------------------- |
| `openAPITS` | `OpenAPITSOptions` | | OpenAPI TS [options](https://openapi-ts.pages.dev/node/#options) |
| `openAPITS` | `OpenAPITSOptions` | | OpenAPI TS [options](https://openapi-ts.pages.dev/node/#options) |
| `addPlugin` | `boolean` | `true` | If enable default plugin to create fetch clients |
| **Clients** | | | |
| `clients.[client]` | `OpenFetchClientOptions` | | Client options |
Expand All @@ -26,4 +26,28 @@ export default defineNuxtConfig({
| `clients.[client].query` | `SearchParameters` | | Adds query search params to URL |
| `clients.[client].schema` | `OpenAPI3Schema` | | Local or remote schema file (YAML or JSON) |

Client can also be configured using `runtimeConfig` or environment variables:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
openFetch: {
clients: {
pets: {}
}
},
runtimeConfig: {
openFetch: {
pets: {
schema: 'https://petstore3.swagger.io/api/v3/openapi.json',
baseURL: 'https://petstore3.swagger.io/api/v3/'
},
},
},
})
```
or:
```sh
NUXT_OPEN_FETCH_PETS_SCHEMA=https://petstore3.swagger.io/api/v3/openapi.json
NUXT_OPEN_FETCH_PETS_BASE_URL=https://petstore3.swagger.io/api/v3/
```

25 changes: 0 additions & 25 deletions docs/content/1.setup/3.schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,3 @@ export default defineNuxtConfig({
}
})
```

Client can also be configured using `runtimeConfig` or environment variables:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
openFetch: {
clients: {
pets: {}
}
},
runtimeConfig: {
openFetch: {
pets: {
schema: 'https://petstore3.swagger.io/api/v3/openapi.json',
baseURL: 'https://petstore3.swagger.io/api/v3/'
},
},
},
})
```
or:
```sh
NUXT_OPEN_FETCH_PETS_SCHEMA=https://petstore3.swagger.io/api/v3/openapi.json
NUXT_OPEN_FETCH_PETS_BASE_URL=https://petstore3.swagger.io/api/v3/
```

0 comments on commit 55a6191

Please sign in to comment.