Skip to content

Commit

Permalink
fixed validate-schema.e2e-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
flamewow committed May 23, 2022
1 parent eed0820 commit abd1ce3
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 321 deletions.
6 changes: 4 additions & 2 deletions e2e/validate-schema.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { ApplicationModule } from './src/app.module';
import { Cat } from './src/cats/classes/cat.class';
import { TagDto } from './src/cats/dto/tag.dto';
import { OpenAPI } from 'openapi-types';
import { OpenAPIV3 } from 'openapi-types';

describe('Validate OpenAPI schema', () => {
let app: INestApplication;
Expand Down Expand Up @@ -109,7 +109,9 @@ describe('Validate OpenAPI schema', () => {
}
});

let api = await SwaggerParser.validate(document as any);
let api = (await SwaggerParser.validate(
document as any
)) as OpenAPIV3.Document;
console.log('API name: %s, Version: %s', api.info.title, api.info.version);
expect(api.components.schemas).toHaveProperty('Person');
expect(api.components.schemas).toHaveProperty('Cat');
Expand Down

0 comments on commit abd1ce3

Please sign in to comment.