Skip to content

Commit d7ec726

Browse files
authored
feat(swagger-ui-react): add showExtensions option (#7563)
Closes #5892
1 parent 83021df commit d7ec726

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

flavors/swagger-ui-react/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ HTTP methods that have the Try it out feature enabled. An empty array disables T
101101

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

104+
#### `showExtensions`: PropTypes.bool
105+
106+
Controls the display of vendor extension (`x-`) fields and values for Operations, Parameters, Responses, and Schema.
107+
108+
⚠️ 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.
109+
104110
#### `showMutatedRequest`: PropTypes.bool
105111

106112
If set to `true`, uses the mutated request returned from a requestInterceptor to produce the curl command in the UI, otherwise the request before the requestInterceptor was applied is used.

flavors/swagger-ui-react/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default class SwaggerUI extends React.Component {
2424
defaultModelExpandDepth: this.props.defaultModelExpandDepth,
2525
displayOperationId: this.props.displayOperationId,
2626
tryItOutEnabled: this.props.tryItOutEnabled,
27+
showExtensions: this.props.showExtensions,
2728
showMutatedRequest: typeof this.props.showMutatedRequest === "boolean" ? this.props.showMutatedRequest : true,
2829
deepLinking: typeof this.props.deepLinking === "boolean" ? this.props.deepLinking : false,
2930
})
@@ -112,4 +113,5 @@ SwaggerUI.defaultProps = {
112113
defaultModelsExpandDepth: 1,
113114
presets: [],
114115
deepLinking: false,
116+
showExtensions: false,
115117
}

0 commit comments

Comments
 (0)