-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Hide the "Download OpenAPI specification" button. #394
Comments
Would be ideal if this could be specified as a tag attribute. |
Would you be able to apply some custom CSS to hide it? As someone who has consumed many third-party APIs I do appreciate being able to easily download specs so my code can use it too, though :) |
There aren't enough classes to really write a "good" css selector but this seems to work, at least in the new 2.0 alpha version, I don't have the prior version handy to see if the markup is the same.
The Anyway, I agree, there really needs to be a config option to disable rendering of the button entirely. For my current usage, we have a private API that we control access to the docs via user login, since our api changes over time and is private, we don't want anyone downloading it. |
@willvincent @bartfeenstra thanks for answering. I will definitely add a config option to hide this button. |
It seems that even if the button is hidden, the spec still downloads to the browser, if that's what the page uses to render the docs. So, the user is still capable of saving it, if that's what they are after doing. |
I guess just hiding the button would be fine for most people. |
New option will be added in the upcoming Usage: <redoc spec-url="..." hide-download-button> </redoc> Important: THIS DOESN'T MAKE YOUR SPEC PRIVATE! As @adamaltman mentioned, the spec still downloads to the browser so the user is still capable of saving it. |
Released in |
This doesn't seem to work when using the React component.
|
Figured it out:
|
if you are using the cli you can use |
Can anyone confirm where this option should be added/defined? I added it here in the redoc.html file within /templates
And the redoc pages no longer rendered! |
@sionlane I think you're missing a comma after |
great, thanks |
is it possible to hide the "Download" button from the .yaml file? |
If you need your spec to be private, you can use redoc to render the spec offline, save the resulting output, and then host only that output. |
Thank you |
hideDownloadButton: true not working with me? |
@vfa-tanna use theme.openapi.hideDownloadButton parameter
|
Is there an easy way to hide this button/functionality? We don't want to expose this option to our users.
The text was updated successfully, but these errors were encountered: