Add OAS3 indicator

This commit is contained in:
Kyle Shockey
2017-05-31 18:47:51 -07:00
parent 38d2a2ae95
commit a0fbcc5dde
6 changed files with 27 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
import React from "react"
const SUPPORTED_OPENAPI_VERSIONS = ["3.0.0-rc0"]
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

View File

@@ -1,7 +1,9 @@
import Markdown from "./markdown"
import parameters from "./parameters"
import VersionStamp from "./version-stamp"
export default {
Markdown,
parameters
parameters,
VersionStamp
}

View File

@@ -0,0 +1,13 @@
import React from "react"
import { OAS3ComponentWrapFactory } from "../helpers"
export default OAS3ComponentWrapFactory((props) => {
const { Ori } = props
return <span>
<Ori {...props} />
<small style={{ backgroundColor: "#89bf04" }}>
<pre className="version">OAS3</pre>
</small>
</span>
})