-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need way to hide curl command from swagger response using configuration #5020
Comments
Here's a plugin that hides the "Curl" section from responses: // index.html
const HideCurlPlugin = () => {
return {
wrapComponents: {
curl: () => () => null
}
}
}
// Build a system
const ui = SwaggerUIBundle({
url: "https://petstore.swagger.io/v2/swagger.json",
...
plugins: [
HideCurlPlugin // <----
],
...
}) |
Is there any way to make a plugin like this that makes the "Curl" section collapsible rather than remove it completely? |
Very good request! The curl section leaks by default the API-KEY (if applicable of course). This is a no go. Think about a little presentation demonstrating a given API to a wider audience and - voila, key is leaked. The first option is to just turn curl off. Works, but I guess we want to see curl once a while. |
I too, would love to see this as a configurable option. |
Content & configuration
Swagger/OpenAPI definition:
# your YAML here
Swagger-UI configuration options:
Is your feature request related to a problem?
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: