Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions flavors/swagger-ui-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Remote URL to an OpenAPI document that Swagger UI will fetch, parse, and display

⚠️ Don't use this in conjunction with `spec` - unpredictable behavior may occur.

#### `layout`: PropTypes.string

The name of a component available via the plugin system to use as the top-level layout for Swagger UI. The default value is `BaseLayout`.

⚠️ 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.

#### `onComplete`: PropTypes.func

> `(system) => void`
Expand Down
10 changes: 7 additions & 3 deletions flavors/swagger-ui-react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default class SwaggerUI extends React.Component {
plugins: this.props.plugins,
spec: this.props.spec,
url: this.props.url,
layout: this.props.layout,
defaultModelsExpandDepth: this.props.defaultModelsExpandDepth,
presets: [presets.apis,...this.props.presets],
requestInterceptor: this.requestInterceptor,
Expand Down Expand Up @@ -85,23 +86,26 @@ SwaggerUI.propTypes = {
PropTypes.object,
]),
url: PropTypes.string,
layout: PropTypes.string,
requestInterceptor: PropTypes.func,
responseInterceptor: PropTypes.func,
onComplete: PropTypes.func,
docExpansion: PropTypes.oneOf(['list', 'full', 'none']),
docExpansion: PropTypes.oneOf(["list", "full", "none"]),
supportedSubmitMethods: PropTypes.arrayOf(
PropTypes.oneOf(['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'])
PropTypes.oneOf(["get", "put", "post", "delete", "options", "head", "patch", "trace"])
),
plugins: PropTypes.arrayOf(PropTypes.object),
displayOperationId: PropTypes.bool,
showMutatedRequest: PropTypes.bool,
defaultModelExpandDepth: PropTypes.number,
defaultModelsExpandDepth: PropTypes.number,
presets: PropTypes.arrayOf(PropTypes.func),
deepLinking: PropTypes.bool,
}

SwaggerUI.defaultProps = {
supportedSubmitMethods: ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'],
layout: "BaseLayout",
supportedSubmitMethods: ["get", "put", "post", "delete", "options", "head", "patch", "trace"],
docExpansion: "list",
defaultModelsExpandDepth: 1,
presets: [],
Expand Down