Add OAS3 indicator
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import Markdown from "./markdown"
|
||||
import parameters from "./parameters"
|
||||
import VersionStamp from "./version-stamp"
|
||||
|
||||
export default {
|
||||
Markdown,
|
||||
parameters
|
||||
parameters,
|
||||
VersionStamp
|
||||
}
|
||||
|
||||
13
src/core/plugins/oas3/wrap-components/version-stamp.jsx
Normal file
13
src/core/plugins/oas3/wrap-components/version-stamp.jsx
Normal 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>
|
||||
})
|
||||
Reference in New Issue
Block a user