diff --git a/packages/apidom-parser-adapter-openapi-json-3-0/src/adapter.ts b/packages/apidom-parser-adapter-openapi-json-3-0/src/adapter.ts index 4f3a6e8f0..23031130c 100644 --- a/packages/apidom-parser-adapter-openapi-json-3-0/src/adapter.ts +++ b/packages/apidom-parser-adapter-openapi-json-3-0/src/adapter.ts @@ -6,7 +6,7 @@ import openApiNamespace, { OpenApi3_0Element } from '@swagger-api/apidom-ns-open export { default as mediaTypes } from './media-types'; -export const detectionRegExp = /"openapi"\s*:\s*"(?3\.0\.([0123])(?:-rc[012])?)"/; +export const detectionRegExp = /"openapi"\s*:\s*"(?3\.0\.([0123]))"/; export const detect = async (source: string): Promise => detectionRegExp.test(source) && (await detectJSON(source)); diff --git a/packages/apidom-parser-adapter-openapi-json-3-0/test/adapter.ts b/packages/apidom-parser-adapter-openapi-json-3-0/test/adapter.ts index 8bf27c153..3c003466e 100644 --- a/packages/apidom-parser-adapter-openapi-json-3-0/test/adapter.ts +++ b/packages/apidom-parser-adapter-openapi-json-3-0/test/adapter.ts @@ -79,6 +79,7 @@ describe('adapter', function () { assert.isFalse(adapter.detectionRegExp.test('"openapi": "3.1.0"')); assert.isFalse(adapter.detectionRegExp.test('"openapi": "3.01.0"')); assert.isFalse(adapter.detectionRegExp.test('"openapi": "3.0.01"')); + assert.isFalse(adapter.detectionRegExp.test('"openapi": "3.0.1-rc1"')); }); }); });