fix: set default supportedSubmitMethods (#6030)
This commit is contained in:
@@ -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'],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user