Skip to content

Instantly share code, notes, and snippets.

@Youka
Created January 28, 2023 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Youka/8b70c113001345ac7ba9fd64776daf50 to your computer and use it in GitHub Desktop.
Save Youka/8b70c113001345ac7ba9fd64776daf50 to your computer and use it in GitHub Desktop.
Swagger-UI plugin: InfoCollapsePlugin
const InfoCollapsePlugin = (system) => {
const React = system.React;
return {
wrapComponents: {
info: (Original) => (props) => React.createElement(
"details",
{
open: true
},
React.createElement(
"summary",
{
style: {
cursor: "pointer",
backgroundColor: "#E0E0E0",
"text-align": "center",
"font-style": "italic"
}
},
"Info"
),
React.createElement(
Original,
props
)
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment