feat(swagger-ui-react): add support for persistAuthorization prop (#7842)

Closes #7389
This commit is contained in:
kyori19
2022-03-01 18:54:03 +09:00
committed by GitHub
parent 8009035fa9
commit 67dd4f6a8d
2 changed files with 9 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ export default class SwaggerUI extends React.Component {
deepLinking: typeof this.props.deepLinking === "boolean" ? this.props.deepLinking : false,
showExtensions: this.props.showExtensions,
filter: ["boolean", "string"].includes(typeof this.props.filter) ? this.props.filter : false,
persistAuthorization: this.props.persistAuthorization,
})
this.system = ui
@@ -122,6 +123,7 @@ SwaggerUI.propTypes = {
requestSnippets: PropTypes.object,
tryItOutEnabled: PropTypes.bool,
displayRequestDuration: PropTypes.bool,
persistAuthorization: PropTypes.bool,
}
SwaggerUI.defaultProps = {
@@ -155,4 +157,5 @@ SwaggerUI.defaultProps = {
defaultExpanded: true,
languages: null, // e.g. only show curl bash = ["curl_bash"]
},
persistAuthorization: false,
}