Skip to content
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

Pass ReDoc UI Parameters using the JavaScript API instead of HTML Tags #25

Merged

Commits on Jul 1, 2024

  1. Fix passing redoc UI parameters

    Currently passing redoc UI parameters has the following issues:
    * It puts json-ed values of parameters in single quotes, which breaks if
      the value itself contains single quotes.
    * If the value is falsy, only the name of the parameter is used. This
      syntax is *not* treated as falsy by redoc.
    
    The latter causes the download button to be always hidden, because the
    default parameters have "hide-download-button": False. There is no way
    to un-hide it with the current code.
    
    Change this to use the javascript API to pass UI parameters[1], which is
    much simpler and more robust.
    
    Also, stop using the "next" version of redoc, as suggested here[2]. This
    was an old release candidate for version 2. Use the officially released
    version 2.
    
    [1] https://redocly.com/docs/redoc/deployment/html/#the-redoc-object
    [2] fastapi/fastapi#9700
    eltoder committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    0b508eb View commit details
    Browse the repository at this point in the history