feat: OpenAPI 3.1 support (#8367)
- New top-level field - `webhooks`. This allows describing out-of-band webhooks that are available as part of the API. - New top-level field - `jsonSchemaDialect`. This allows defining of a default `$schema` value for Schema Objects - The Info Object has a new `summary` field. - The License Object now has a new `identifier` field for SPDX licenses. This `identifier` field is mutually exclusive with the `url` field. Either can be used in OpenAPI 3.1 definitions. - Components Object now has a new entry `pathItems`, to allow for reusable Path Item Objects to be defined within a valid OpenAPI document. - `License` and `Contact` components are now exported and available via `getComponent` - New version predicates and selectors for `isOpenAPI30` and `isOpenAPI31`. This avoids needing to change the usage of `isOAS3` selector. - New OAS3 components: `Webhooks` - New OAS3 wrapped components: `Info`, `License`
This commit is contained in:
@@ -23,7 +23,7 @@ export class InfoBasePath extends React.Component {
|
||||
}
|
||||
|
||||
|
||||
class Contact extends React.Component {
|
||||
export class Contact extends React.Component {
|
||||
static propTypes = {
|
||||
data: PropTypes.object,
|
||||
getComponent: PropTypes.func.isRequired,
|
||||
@@ -53,7 +53,7 @@ class Contact extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
class License extends React.Component {
|
||||
export class License extends React.Component {
|
||||
static propTypes = {
|
||||
license: PropTypes.object,
|
||||
getComponent: PropTypes.func.isRequired,
|
||||
@@ -64,7 +64,6 @@ class License extends React.Component {
|
||||
|
||||
render(){
|
||||
let { license, getComponent, selectedServer, url: specUrl } = this.props
|
||||
|
||||
const Link = getComponent("Link")
|
||||
let name = license.get("name") || "License"
|
||||
let url = safeBuildUrl(license.get("url"), specUrl, {selectedServer})
|
||||
@@ -125,6 +124,7 @@ export default class Info extends React.Component {
|
||||
const VersionStamp = getComponent("VersionStamp")
|
||||
const InfoUrl = getComponent("InfoUrl")
|
||||
const InfoBasePath = getComponent("InfoBasePath")
|
||||
const License = getComponent("License")
|
||||
|
||||
return (
|
||||
<div className="info">
|
||||
|
||||
@@ -20,6 +20,7 @@ export default class BaseLayout extends React.Component {
|
||||
let VersionPragmaFilter = getComponent("VersionPragmaFilter")
|
||||
let Operations = getComponent("operations", true)
|
||||
let Models = getComponent("Models", true)
|
||||
let Webhooks = getComponent("Webhooks", true)
|
||||
let Row = getComponent("Row")
|
||||
let Col = getComponent("Col")
|
||||
let Errors = getComponent("errors", true)
|
||||
@@ -30,6 +31,7 @@ export default class BaseLayout extends React.Component {
|
||||
const FilterContainer = getComponent("FilterContainer", true)
|
||||
let isSwagger2 = specSelectors.isSwagger2()
|
||||
let isOAS3 = specSelectors.isOAS3()
|
||||
const isOpenAPI31 = specSelectors.selectIsOpenAPI31()
|
||||
|
||||
const isSpecEmpty = !specSelectors.specStr()
|
||||
|
||||
@@ -112,6 +114,13 @@ export default class BaseLayout extends React.Component {
|
||||
<Operations/>
|
||||
</Col>
|
||||
</Row>
|
||||
{ isOpenAPI31 &&
|
||||
<Row className="webhooks-container">
|
||||
<Col mobile={12} desktop={12} >
|
||||
<Webhooks />
|
||||
</Col>
|
||||
</Row>
|
||||
}
|
||||
<Row>
|
||||
<Col mobile={12} desktop={12} >
|
||||
<Models/>
|
||||
|
||||
Reference in New Issue
Block a user