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

Improve Swagger UI Config Support #16

Open
SteadBytes opened this issue Jan 17, 2020 · 8 comments
Open

Improve Swagger UI Config Support #16

SteadBytes opened this issue Jan 17, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@SteadBytes
Copy link
Contributor

#14 (comment)

A general solution to configuring Swagger UI JavaScript options will eliminate the need for adding in one off Flask config options whenevr a user requests them.

TODO: Further details and document current ideas. This is mainly here as a placeholder so the issue doesn't get lost.

@SteadBytes SteadBytes self-assigned this Jan 17, 2020
@SVilgelm SVilgelm added the enhancement New feature or request label Feb 12, 2020
@michaelbukachi
Copy link

Hello, following up the discussion on #100. What do you think about the following solution.
Firstly, we have SWAGGER_UI_OPTIONS in config whic is a dict object. The keys of the dict have to be valid swagger options e.g:

SWAGGER_UI_OPTIONS = {
    displayOperationId: false,
    docExpansion: 'none'
    ....
}

Then when parsing the options in swagger-ui.html, we can make use of the spread operator in case a default option is being overriden like so:

const options = {{ config.SWAGGER_UI_OPTIONS | default({}) | tojson }}
const ui = window.ui = new SwaggerUIBundle({
    // Other options
    ...options
})

@ziirish
Copy link
Contributor

ziirish commented Mar 29, 2020

I like this idea.
I'll give it a try when I have a moment.

Thanks for the suggestion.

@michaelbukachi
Copy link

@ziirish Have you been able to take a look at this?

@engmsilva
Copy link

Is there any discussion to add this configuration?

DEFAULT_MODELS_EXPAND_DEPTH = -1

@michaelbukachi
Copy link

@engmsilva The plan is to support all configurations so that developers can specify what configurations they want to pass into swagger.

@fjbf
Copy link

fjbf commented Dec 27, 2020

+1

@SteadBytes SteadBytes removed their assignment May 5, 2021
@dshein-alt
Copy link

Is there any news about support additional Swagger options?

@kjwill
Copy link

kjwill commented Aug 29, 2022

Hi, any updates on this? +1 I would use this feature

If we're just waiting on someone to implement it, I can do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants