Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/openapi-schema-validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import ajv, { ValidateFunction, ErrorObject } from 'ajv';
import addFormats from 'ajv-formats';
const openapi2Schema = require('./resources/openapi-2.0.json');
const openapi3Schema = require('./resources/openapi-3.0.json');
const merge = require('lodash.merge');
import { IJsonSchema, OpenAPI } from 'openapi-types';

export interface IOpenAPISchemaValidator {
Expand All @@ -28,7 +27,7 @@ export default class OpenAPISchemaValidator implements IOpenAPISchemaValidator {
const v = new ajv({ allErrors: true, strict: false });
addFormats(v);
const version = (args && parseInt(String(args.version), 10)) || 2;
const schema = merge(
const schema = Object.assign(
{},
version === 2 ? openapi2Schema : openapi3Schema,
args ? args.extensions : {}
Expand Down
1 change: 0 additions & 1 deletion packages/openapi-schema-validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"dependencies": {
"ajv": "^8.1.0",
"ajv-formats": "^2.0.2",
"lodash.merge": "^4.6.1",
"openapi-types": "^12.1.3"
}
}