Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/reference/plugins/openapi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ npm install --save-dev @zenstackhq/openapi
| description | String | API description | No | |
| summary | String | API summary | No | |
| securitySchemes | Object | Security schemes for the API. See [here](#security-schemes) for more details. | No | |
| includeOpenApiIgnored | Boolean | If true, models tagged with `@@openapi.ignore` are included in the generated spec. | No | false |
| omitInputDetails | Boolean | **Only valid for "rpc" flavor.** If true, the output spec will not contain detailed structures for query/mutation input fields like `where`, `select`, `data`, etc. These fields will be typed as generic objects. Use this option to reduce the size of the generated spec. | No | false |
| modelNameMapping | Object | **Only effective for "rest" flavor.** See [here](#model-name-mapping) for more details. | No | |

Expand Down Expand Up @@ -179,6 +180,23 @@ model User {

Mark a data model to be ignored when generating OpenAPI specification.

By default, ignored models are excluded from the spec. If you set the plugin option `includeOpenApiIgnored = true`, they will be included.
This is useful when you want to generate two different specs, for example a public spec for customers and an internal spec for your team (which may include additional internal models).

You can configure the plugin twice with different outputs and distinct block names:

```zmodel
plugin openapiPublic {
provider = '@zenstackhq/openapi'
output = './openapi-public.yaml'
}

plugin openapiInternal {
provider = '@zenstackhq/openapi'
output = './openapi-internal.yaml'
includeOpenApiIgnored = true
}
```
### Example

```zmodel title='schema.zmodel'
Expand Down