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:
@@ -7,8 +7,11 @@ import { Iterable, fromJS, Map } from "immutable"
|
||||
export default class OperationContainer extends PureComponent {
|
||||
constructor(props, context) {
|
||||
super(props, context)
|
||||
|
||||
const { tryItOutEnabled } = props.getConfigs()
|
||||
|
||||
this.state = {
|
||||
tryItOutEnabled: false,
|
||||
tryItOutEnabled: tryItOutEnabled === true || tryItOutEnabled === "true",
|
||||
executeInProgress: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ export default function SwaggerUI(opts) {
|
||||
displayOperationId: false,
|
||||
displayRequestDuration: false,
|
||||
deepLinking: false,
|
||||
tryItOutEnabled: false,
|
||||
requestInterceptor: (a => a),
|
||||
responseInterceptor: (a => a),
|
||||
showMutatedRequest: true,
|
||||
|
||||
@@ -63,7 +63,7 @@ export default function authorize ( { auth, authActions, errActions, configs, au
|
||||
scopesArray = scopes.toArray()
|
||||
}
|
||||
|
||||
if (scopesArray.length > 0) {
|
||||
if (scopesArray.length > 0) {
|
||||
let scopeSeparator = authConfigs.scopeSeparator || " "
|
||||
|
||||
query.push("scope=" + encodeURIComponent(scopesArray.join(scopeSeparator)))
|
||||
|
||||
Reference in New Issue
Block a user