Skip to content

Commit

Permalink
bg(apidom-parser-adapter-openapi-json-3-0): remove rc version support
Browse files Browse the repository at this point in the history
  • Loading branch information
Vazha Omanashvili committed Aug 16, 2024
1 parent d87238a commit 8a22e90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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*"(?<version_json>3\.0\.([0123])(?:-rc[012])?)"/;
export const detectionRegExp = /"openapi"\s*:\s*"(?<version_json>3\.0\.([0123]))"/;

export const detect = async (source: string): Promise<boolean> =>
detectionRegExp.test(source) && (await detectJSON(source));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"'));
});
});
});

0 comments on commit 8a22e90

Please sign in to comment.