Skip to content

Commit 3296e2e

Browse files
authored
feat(swagger-ui-react): export presets and plugins as static props (#7927)
Closes #7923
1 parent 22eef0a commit 3296e2e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

flavors/swagger-ui-react/index.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react"
22
import PropTypes from "prop-types"
3-
import swaggerUIConstructor, {presets} from "./swagger-ui-es-bundle-core"
3+
import swaggerUIConstructor from "./swagger-ui-es-bundle-core"
4+
45
export default class SwaggerUI extends React.Component {
56
constructor (props) {
67
super(props)
@@ -16,7 +17,7 @@ export default class SwaggerUI extends React.Component {
1617
layout: this.props.layout,
1718
defaultModelsExpandDepth: this.props.defaultModelsExpandDepth,
1819
defaultModelRendering: this.props.defaultModelRendering,
19-
presets: [presets.apis,...this.props.presets],
20+
presets: [swaggerUIConstructor.presets.apis,...this.props.presets],
2021
requestInterceptor: this.requestInterceptor,
2122
responseInterceptor: this.responseInterceptor,
2223
onComplete: this.onComplete,
@@ -163,3 +164,6 @@ SwaggerUI.defaultProps = {
163164
},
164165
persistAuthorization: false,
165166
}
167+
168+
SwaggerUI.presets = swaggerUIConstructor.presets;
169+
SwaggerUI.plugins = swaggerUIConstructor.plugins;

0 commit comments

Comments
 (0)