Skip to content

Commit 8f92385

Browse files
docs: add description for new plugin option "includeOpenApiIgnored" (#486)
* docs: add description for new plugin option "includeOpenApiIgnored" * fix: distinct plugin block names and spelling of attributes
1 parent 993a1c3 commit 8f92385

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/reference/plugins/openapi.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ npm install --save-dev @zenstackhq/openapi
2626
| description | String | API description | No | |
2727
| summary | String | API summary | No | |
2828
| securitySchemes | Object | Security schemes for the API. See [here](#security-schemes) for more details. | No | |
29+
| includeOpenApiIgnored | Boolean | If true, models tagged with `@@openapi.ignore` are included in the generated spec. | No | false |
2930
| 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 |
3031
| modelNameMapping | Object | **Only effective for "rest" flavor.** See [here](#model-name-mapping) for more details. | No | |
3132

@@ -179,6 +180,23 @@ model User {
179180

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

183+
By default, ignored models are excluded from the spec. If you set the plugin option `includeOpenApiIgnored = true`, they will be included.
184+
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).
185+
186+
You can configure the plugin twice with different outputs and distinct block names:
187+
188+
```zmodel
189+
plugin openapiPublic {
190+
provider = '@zenstackhq/openapi'
191+
output = './openapi-public.yaml'
192+
}
193+
194+
plugin openapiInternal {
195+
provider = '@zenstackhq/openapi'
196+
output = './openapi-internal.yaml'
197+
includeOpenApiIgnored = true
198+
}
199+
```
182200
### Example
183201

184202
```zmodel title='schema.zmodel'

0 commit comments

Comments
 (0)