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

@@ -13,8 +13,11 @@ describe("isOAS3", function () {
it("should recognize valid OAS3 version values", function () {
expect(isOAS3Shorthand("3.0.0")).toEqual(true)
expect(isOAS3Shorthand("3.0.1")).toEqual(true)
expect(isOAS3Shorthand("3.0.11111")).toEqual(false)
expect(isOAS3Shorthand("3.0.0-rc0")).toEqual(true)
expect(isOAS3Shorthand("3.0.4")).toEqual(true)
expect(isOAS3Shorthand("3.0.11111")).toEqual(true)
expect(isOAS3Shorthand("3.0.0-rc0")).toEqual(false)
})
it("should fail for invalid OAS3 version values", function () {

View File

@@ -0,0 +1,15 @@
import { fromJS } from "immutable"
import { isOAS31 } from "core/plugins/oas31/fn"
const isOAS31Shorthand = (version) => isOAS31(fromJS({
openapi: version
}))
describe("isOAS31", function () {
it("should recognize valid OAS31 version values", function () {
expect(isOAS31Shorthand("3.1.0")).toEqual(true)
expect(isOAS31Shorthand("3.1.1")).toEqual(true)
expect(isOAS31Shorthand("3.2.0")).toEqual(false)
expect(isOAS31Shorthand("3.0.0-rc0")).toEqual(false)
})
})