未验证 提交 6f1dd08e 编写于 作者: M MoOmEeN 提交者: GitHub

support for supportedSubmitMethods property in react component (#5376)

* support for supportedSubmitMethods property in react component

* update react README
Co-authored-by: NRadek <radek.miazio@skysanner.net>
Co-authored-by: Nkyle shockey <kyle.shockey1@gmail.com>
上级 95e72e7c
......@@ -83,6 +83,12 @@ An array of objects that augment and modify Swagger UI's functionality. See Swag
⚠️ This prop is currently only applied once, on mount. Changes to this prop's value will not be propagated to the underlying Swagger UI instance. A future version of this module will remove this limitation, and the change will not be considered a breaking change.
#### `supportedSubmitMethods`: PropTypes.arrayOf(PropTypes.oneOf(['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace']))
HTTP methods that have the Try it out feature enabled. An empty array disables Try it out for all operations. This does not filter the operations from the display.
⚠️ This prop is currently only applied once, on mount. Changes to this prop's value will not be propagated to the underlying Swagger UI instance. A future version of this module will remove this limitation, and the change will not be considered a breaking change.
## Limitations
* Not all configuration bindings are available.
......
......@@ -18,6 +18,7 @@ export default class SwaggerUI extends React.Component {
responseInterceptor: this.responseInterceptor,
onComplete: this.onComplete,
docExpansion: this.props.docExpansion,
supportedSubmitMethods: this.props.supportedSubmitMethods,
defaultModelExpandDepth: this.props.defaultModelExpandDepth,
})
......@@ -84,6 +85,9 @@ SwaggerUI.propTypes = {
responseInterceptor: PropTypes.func,
onComplete: PropTypes.func,
docExpansion: PropTypes.oneOf(['list', 'full', 'none']),
supportedSubmitMethods: PropTypes.arrayOf(
PropTypes.oneOf(['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'])
),
defaultModelExpandDepth: PropTypes.number,
plugins: PropTypes.arrayOf(PropTypes.object),
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册