@har-sdk/core
Version:
The base package can be used to import specification files (i.e. HAR, OAS and Postman Collection) and detect their type.
18 lines • 681 B
JavaScript
import { ImporterType } from './ImporterType';
import { BaseOASImporter } from './BaseOASImporter';
export class OASV3Importer extends BaseOASImporter {
constructor() {
super();
this.SUPPORTED_OPENAPI_VERSION = /^3\.[01]\.\d+$/; // 3.0.x or 3.1.x
}
get type() {
return ImporterType.OASV3;
}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
isSupported(spec) {
const version = spec === null || spec === void 0 ? void 0 : spec.openapi;
return (typeof version === 'string' &&
this.SUPPORTED_OPENAPI_VERSION.test(version.trim()));
}
}
//# sourceMappingURL=OASV3Importer.js.map