feat(swagger-ui-react): option for showMutatedRequest (#6273)
Co-authored-by: neel <neelima.sri.vathsavai@autodesk.com>
This commit is contained in:
@@ -95,6 +95,12 @@ HTTP methods that have the Try it out feature enabled. An empty array disables T
|
|||||||
|
|
||||||
⚠️ 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.
|
⚠️ 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.
|
||||||
|
|
||||||
|
#### `showMutatedRequest`: PropTypes.bool
|
||||||
|
|
||||||
|
If set to `true`, uses the mutated request returned from a requestInterceptor to produce the curl command in the UI, otherwise the request before the requestInterceptor was applied is used.
|
||||||
|
|
||||||
|
⚠️ 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
|
## Limitations
|
||||||
|
|
||||||
* Not all configuration bindings are available.
|
* Not all configuration bindings are available.
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export default class SwaggerUI extends React.Component {
|
|||||||
supportedSubmitMethods: this.props.supportedSubmitMethods,
|
supportedSubmitMethods: this.props.supportedSubmitMethods,
|
||||||
defaultModelExpandDepth: this.props.defaultModelExpandDepth,
|
defaultModelExpandDepth: this.props.defaultModelExpandDepth,
|
||||||
displayOperationId: this.props.displayOperationId,
|
displayOperationId: this.props.displayOperationId,
|
||||||
|
showMutatedRequest: typeof this.props.showMutatedRequest === "boolean" ? this.props.showMutatedRequest : true,
|
||||||
})
|
})
|
||||||
|
|
||||||
this.system = ui
|
this.system = ui
|
||||||
@@ -92,6 +93,7 @@ SwaggerUI.propTypes = {
|
|||||||
defaultModelExpandDepth: PropTypes.number,
|
defaultModelExpandDepth: PropTypes.number,
|
||||||
plugins: PropTypes.arrayOf(PropTypes.object),
|
plugins: PropTypes.arrayOf(PropTypes.object),
|
||||||
displayOperationId: PropTypes.bool,
|
displayOperationId: PropTypes.bool,
|
||||||
|
showMutatedRequest: PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
SwaggerUI.defaultProps = {
|
SwaggerUI.defaultProps = {
|
||||||
|
|||||||
Reference in New Issue
Block a user