We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6a7d2f commit 0509c5aCopy full SHA for 0509c5a
src/helpers/openapi-predicates.js
@@ -9,7 +9,7 @@ export const isOpenAPI2 = (spec) => {
9
export const isOpenAPI30 = (spec) => {
10
try {
11
const { openapi } = spec;
12
- return typeof openapi === 'string' && openapi.startsWith('3.0');
+ return typeof openapi === 'string' && /^3\.0\.([0123])(?:-rc[012])?$/.test(openapi);
13
} catch {
14
return false;
15
}
@@ -18,7 +18,7 @@ export const isOpenAPI30 = (spec) => {
18
export const isOpenAPI31 = (spec) => {
19
20
21
- return typeof openapi === 'string' && openapi.startsWith('3.1');
+ return typeof openapi === 'string' && /^3\.1\.(?:[1-9]\d*|0)$/.test(openapi);
22
23
24
0 commit comments