Skip to content

Commit

Permalink
fix(apidom-parser-adapter-openapi-json-3-0): drop rc version support (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rainum authored Aug 16, 2024
1 parent d87238a commit b8afa76
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 b8afa76

Please sign in to comment.