Skip to content

Commit

Permalink
fix: add extra model
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoGathK committed Aug 31, 2022
1 parent 673fe55 commit 00132e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Injectable, INestApplication } from '@vodyani/core';
import { SwaggerDocumentOptions, SwaggerModule, OpenAPIObject, DocumentBuilder } from '@nestjs/swagger';

import { ExtraModelStore } from './struct';

@Injectable()
export class SwaggerProvider {
public getConfigBuilder() {
Expand All @@ -13,7 +15,11 @@ export class SwaggerProvider {
config: Omit<OpenAPIObject, 'paths'>,
options?: SwaggerDocumentOptions,
) {
const document = SwaggerModule.createDocument(application, config, options);
const document = SwaggerModule.createDocument(
application,
config,
{ extraModels: ExtraModelStore.get(), ...options },
);

SwaggerModule.setup(path, application, document);
}
Expand Down

0 comments on commit 00132e3

Please sign in to comment.