diff --git a/e2e/validate-schema.e2e-spec.ts b/e2e/validate-schema.e2e-spec.ts index 86924515b..ca514e0c2 100644 --- a/e2e/validate-schema.e2e-spec.ts +++ b/e2e/validate-schema.e2e-spec.ts @@ -49,7 +49,7 @@ describe('Validate OpenAPI schema', () => { }); it('should produce a valid OpenAPI 3.0 schema', async () => { - const document = SwaggerModule.createDocument(app, options, { + SwaggerModule.loadPluginMetadata({ metadata: { '@nestjs/swagger': { models: [ @@ -91,6 +91,7 @@ describe('Validate OpenAPI schema', () => { } } }); + const document = SwaggerModule.createDocument(app, options); const doc = JSON.stringify(document, null, 2); writeFileSync(join(__dirname, 'api-spec.json'), doc); diff --git a/lib/swagger-module.ts b/lib/swagger-module.ts index 6bd4ebddd..3e73014a2 100644 --- a/lib/swagger-module.ts +++ b/lib/swagger-module.ts @@ -46,7 +46,7 @@ export class SwaggerModule { }; } - public static async load(metadata: Record) { + public static async loadPluginMetadata(metadata: Record) { return this.metadataLoader.load(metadata); }