Skip to content

Commit 18dd6f0

Browse files
feat: option to include models tagged with @openapi.ignore in the spec file (#2221)
1 parent 1178e76 commit 18dd6f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/plugins/openapi/src/generator-base.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export abstract class OpenAPIGeneratorBase {
1515
abstract generate(): PluginResult;
1616

1717
protected get includedModels() {
18-
return getDataModels(this.model).filter((d) => !hasAttribute(d, '@@openapi.ignore'));
18+
const includeOpenApiIgnored = this.getOption<boolean>('includeOpenApiIgnored', false);
19+
const models = getDataModels(this.model);
20+
return includeOpenApiIgnored ? models : models.filter((d) => !hasAttribute(d, '@@openapi.ignore'));
1921
}
2022

2123
protected wrapArray(

0 commit comments

Comments
 (0)