Skip to content

Commit 3b6942c

Browse files
authoredJun 3, 2020
fix: set default supportedSubmitMethods (#6030)
1 parent 465b18d commit 3b6942c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
 

‎flavors/swagger-ui-react/index.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class SwaggerUI extends React.Component {
88
this.SwaggerUIComponent = null
99
this.system = null
1010
}
11-
11+
1212
componentDidMount() {
1313
const ui = swaggerUIConstructor({
1414
plugins: this.props.plugins,
@@ -27,7 +27,7 @@ export default class SwaggerUI extends React.Component {
2727

2828
this.forceUpdate()
2929
}
30-
30+
3131
render() {
3232
return this.SwaggerUIComponent ? <this.SwaggerUIComponent /> : null
3333
}
@@ -41,7 +41,7 @@ export default class SwaggerUI extends React.Component {
4141
// update the internal URL
4242
this.system.specActions.updateUrl(this.props.url)
4343
// trigger remote definition fetch
44-
this.system.specActions.download(this.props.url)
44+
this.system.specActions.download(this.props.url)
4545
}
4646
}
4747

@@ -91,3 +91,7 @@ SwaggerUI.propTypes = {
9191
defaultModelExpandDepth: PropTypes.number,
9292
plugins: PropTypes.arrayOf(PropTypes.object),
9393
}
94+
95+
SwaggerUI.defaultProps = {
96+
supportedSubmitMethods: ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'],
97+
}

0 commit comments

Comments
 (0)
Please sign in to comment.