diff --git a/flavors/swagger-ui-react/README.md b/flavors/swagger-ui-react/README.md index 0fefd5b6c97..b3d9feb1814 100644 --- a/flavors/swagger-ui-react/README.md +++ b/flavors/swagger-ui-react/README.md @@ -45,8 +45,12 @@ Remote URL to an OpenAPI document that Swagger UI will fetch, parse, and display #### `onComplete`: PropTypes.func +> `(system) => void` + A callback function that is triggered when Swagger-UI finishes rendering an OpenAPI document. +Swagger UI's `system` object is passed as an argument. + #### `requestInterceptor`: PropTypes.func > `req => req` or `req => Promise`. diff --git a/flavors/swagger-ui-react/index.js b/flavors/swagger-ui-react/index.js index bd24c9e2aa7..c19ca93b841 100644 --- a/flavors/swagger-ui-react/index.js +++ b/flavors/swagger-ui-react/index.js @@ -66,7 +66,7 @@ export default class SwaggerUI extends React.Component { onComplete = () => { if (typeof this.props.onComplete === "function") { - return this.props.onComplete() + return this.props.onComplete(this.system) } } } @@ -80,4 +80,4 @@ SwaggerUI.propTypes = { requestInterceptor: PropTypes.func, responseInterceptor: PropTypes.func, onComplete: PropTypes.func, -} \ No newline at end of file +}