Browse Source

fix: set default supportedSubmitMethods (#6030)

bubble
Brian Wright 4 years ago
committed by GitHub
parent
commit
3b6942c13a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      flavors/swagger-ui-react/index.js

+ 7
- 3
flavors/swagger-ui-react/index.js View File

@@ -8,7 +8,7 @@ export default class SwaggerUI extends React.Component {
this.SwaggerUIComponent = null
this.system = null
}
componentDidMount() {
const ui = swaggerUIConstructor({
plugins: this.props.plugins,
@@ -27,7 +27,7 @@ export default class SwaggerUI extends React.Component {

this.forceUpdate()
}
render() {
return this.SwaggerUIComponent ? <this.SwaggerUIComponent /> : null
}
@@ -41,7 +41,7 @@ export default class SwaggerUI extends React.Component {
// update the internal URL
this.system.specActions.updateUrl(this.props.url)
// trigger remote definition fetch
this.system.specActions.download(this.props.url)
this.system.specActions.download(this.props.url)
}
}

@@ -91,3 +91,7 @@ SwaggerUI.propTypes = {
defaultModelExpandDepth: PropTypes.number,
plugins: PropTypes.arrayOf(PropTypes.object),
}

SwaggerUI.defaultProps = {
supportedSubmitMethods: ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'],
}

Loading…
Cancel
Save