feat(info): indicate OpenAPI 2.0 definition version (#9167)
This commit is contained in:
committed by
GitHub
parent
6fd6e339cc
commit
4b48e36c09
@@ -89,6 +89,7 @@ class Info extends React.Component {
|
||||
const Markdown = getComponent("Markdown", true)
|
||||
const Link = getComponent("Link")
|
||||
const VersionStamp = getComponent("VersionStamp")
|
||||
const OpenAPIVersion = getComponent("OpenAPIVersion")
|
||||
const InfoUrl = getComponent("InfoUrl")
|
||||
const InfoBasePath = getComponent("InfoBasePath")
|
||||
const License = getComponent("License")
|
||||
@@ -99,7 +100,8 @@ class Info extends React.Component {
|
||||
<hgroup className="main">
|
||||
<h2 className="title">
|
||||
{title}
|
||||
{version && <VersionStamp version={version}></VersionStamp>}
|
||||
{version && <VersionStamp version={version} />}
|
||||
<OpenAPIVersion oasVersion="2.0" />
|
||||
</h2>
|
||||
{host || basePath ? (
|
||||
<InfoBasePath host={host} basePath={basePath} />
|
||||
|
||||
15
src/core/components/openapi-version.jsx
Normal file
15
src/core/components/openapi-version.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from "react"
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
|
||||
const OpenAPIVersion = ({ oasVersion }) => (
|
||||
<small className="version-stamp">
|
||||
<pre className="version">OAS {oasVersion}</pre>
|
||||
</small>
|
||||
)
|
||||
|
||||
OpenAPIVersion.propTypes = {
|
||||
oasVersion: PropTypes.string.isRequired
|
||||
}
|
||||
|
||||
export default OpenAPIVersion
|
||||
Reference in New Issue
Block a user