blueswen / mkdocs-swagger-ui-tag

A MkDocs plugin supports adding Swagger UI to the page.
https://blueswen.github.io/mkdocs-swagger-ui-tag/
MIT License
75 stars 7 forks source link

tryItOutEnabled: false is ignored #12

Closed Andre601 closed 4 months ago

Andre601 commented 1 year ago

Setting tryItOutEnabled: false in the plugin's setting is being ignored, since the "Try it out" button is still being displayed and can be toggled.

mkdocs.yml settings:

plugins:
  - search
  - swagger-ui-tag:
      tryItOutEnabled: false

Result: grafik

blueswen commented 1 year ago

To resolve this issue, you can add an additional option supportedSubmitMethods to your YAML configuration file with an empty array as its value temporary, like so:

plugins:
  - swagger-ui-tag:
      tryItOutEnabled: false
      supportedSubmitMethods: []
Swagger UI Tag Demo

I need some time to find out how to fix this issue. It's possible that I may have misunderstood the configuration options outlined in the Swagger UI documentation, but I'm working to figure it out.

blueswen commented 1 year ago

@Andre601 Sorry for the late reply.

To disable the "Try It Out" feature, you can either set supportedSubmitMethods as an empty array or specify a list of methods that you want to enable.

The tryItOutEnabled option determines whether the Try It Out section (parameter and body) is editable by default. The effect is as follows when tryItOutEnabled is true:

tryItOutEnabled is true

The body is editable when the operation panel expands and Execute button is showing by default.