From fbdd01d864cd513083b29615efae24ce4f42aae1 Mon Sep 17 00:00:00 2001 From: Jordan Garside Date: Mon, 13 Jan 2020 20:14:20 -0800 Subject: [PATCH] feat(swagger-ui-react): add `displayOperationId` config support --- flavors/swagger-ui-react/README.md | 6 ++++++ flavors/swagger-ui-react/index.js | 2 ++ 2 files changed, 8 insertions(+) diff --git a/flavors/swagger-ui-react/README.md b/flavors/swagger-ui-react/README.md index b6fa11f666c..9e24305379b 100644 --- a/flavors/swagger-ui-react/README.md +++ b/flavors/swagger-ui-react/README.md @@ -77,6 +77,12 @@ The default expansion depth for models (set to -1 completely hide the models). ⚠️ 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. +#### `displayOperationId`: PropTypes.bool + +Controls the display of operationId in operations list. The default is false. + +⚠️ 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. + #### `plugins`: PropTypes.arrayOf(PropTypes.object), An array of objects that augment and modify Swagger UI's functionality. See Swagger UI's [Plugin API](https://github.com/swagger-api/swagger-ui/blob/master/docs/customization/plugin-api.md) for more details. diff --git a/flavors/swagger-ui-react/index.js b/flavors/swagger-ui-react/index.js index 6ba415504de..c9619487a1a 100644 --- a/flavors/swagger-ui-react/index.js +++ b/flavors/swagger-ui-react/index.js @@ -19,6 +19,7 @@ export default class SwaggerUI extends React.Component { onComplete: this.onComplete, docExpansion: this.props.docExpansion, defaultModelExpandDepth: this.props.defaultModelExpandDepth, + displayOperationId: this.props.displayOperationId, }) this.system = ui @@ -86,4 +87,5 @@ SwaggerUI.propTypes = { docExpansion: PropTypes.oneOf(['list', 'full', 'none']), defaultModelExpandDepth: PropTypes.number, plugins: PropTypes.arrayOf(PropTypes.object), + displayOperationId: PropTypes.bool, }