diff --git a/src/core/plugins/oas3/helpers.js b/src/core/plugins/oas3/helpers.js index 93ece564..92d229a5 100644 --- a/src/core/plugins/oas3/helpers.js +++ b/src/core/plugins/oas3/helpers.js @@ -1,6 +1,6 @@ import React from "react" -const SUPPORTED_OPENAPI_VERSIONS = ["3.0.0-rc0", "3.0.0-RC1"] +export const SUPPORTED_OPENAPI_VERSIONS = ["3.0.0-rc0", "3.0.0-RC1"] export function isOAS3(jsSpec) { return !!jsSpec.openapi && SUPPORTED_OPENAPI_VERSIONS.indexOf(jsSpec.openapi) > -1 diff --git a/src/core/plugins/oas3/wrap-selectors.js b/src/core/plugins/oas3/wrap-selectors.js index 72f01ca7..edbe0bca 100644 --- a/src/core/plugins/oas3/wrap-selectors.js +++ b/src/core/plugins/oas3/wrap-selectors.js @@ -1,5 +1,6 @@ import { createSelector } from "reselect" import { Map } from "immutable" +import { SUPPORTED_OPENAPI_VERSIONS } from "./helpers" // Helpers @@ -7,7 +8,7 @@ function onlyOAS3(selector) { return (ori, system) => (...args) => { const spec = system.getSystem().specSelectors.specJson() const version = spec.get("openapi") - if(typeof version === "string" && version.startsWith("3.0.0")) { + if(typeof version === "string" && SUPPORTED_OPENAPI_VERSIONS.indexOf(version) > -1) { return selector(...args) } else { return ori(...args)