feat: add support for OpenAPI 3.0.4 (#10247)

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Co-authored-by: Vladimír Gorej <vladimir.gorej@gmail.com>
This commit is contained in:
Vincent Biret
2025-02-17 10:33:11 -05:00
committed by GitHub
parent 5d1c42c834
commit d437474b0c
4 changed files with 33 additions and 15 deletions

View File

@@ -7,8 +7,7 @@ export function isOAS30(jsSpec) {
const oasVersion = jsSpec.get("openapi")
return (
typeof oasVersion === "string" &&
/^3\.0\.([0123])(?:-rc[012])?$/.test(oasVersion)
typeof oasVersion === "string" && /^3\.0\.(?:[1-9]\d*|0)$/.test(oasVersion)
)
}