feat: add tryItOutEnabled configuration (#6865)
* feat: add tryItOutEnabled configuration allow users to set tryItOutEnabled: true to display the "Try it out" section by default tryItOutEnabled to take === "true" for the query string value or === true if someone implements query string type parsing in the query
This commit is contained in:
@@ -113,6 +113,12 @@ An array of functions that augment and modify Swagger UI's functionality. See Sw
|
||||
|
||||
⚠️ 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.
|
||||
|
||||
#### `tryItOutEnabled`: PropTypes.bool
|
||||
|
||||
Controls whether the "Try it out" section should start enabled. The default is false.
|
||||
|
||||
⚠️ 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.
|
||||
|
||||
@@ -23,6 +23,7 @@ export default class SwaggerUI extends React.Component {
|
||||
supportedSubmitMethods: this.props.supportedSubmitMethods,
|
||||
defaultModelExpandDepth: this.props.defaultModelExpandDepth,
|
||||
displayOperationId: this.props.displayOperationId,
|
||||
tryItOutEnabled: this.props.tryItOutEnabled,
|
||||
showMutatedRequest: typeof this.props.showMutatedRequest === "boolean" ? this.props.showMutatedRequest : true,
|
||||
deepLinking: typeof this.props.deepLinking === "boolean" ? this.props.deepLinking : false,
|
||||
})
|
||||
@@ -101,6 +102,7 @@ SwaggerUI.propTypes = {
|
||||
defaultModelsExpandDepth: PropTypes.number,
|
||||
presets: PropTypes.arrayOf(PropTypes.func),
|
||||
deepLinking: PropTypes.bool,
|
||||
tryItOutEnabled: PropTypes.bool
|
||||
}
|
||||
|
||||
SwaggerUI.defaultProps = {
|
||||
Reference in New Issue
Block a user