Skip to content

Improve and fix code rendering and parsing of parameter allowed values and defaults #10949

Description

@fmigneault

Content & configuration

Swagger/OpenAPI definition:

api.yaml

Using latest https://github.com/swagger-api/swagger-ui/releases/tag/v5.32.8

Swagger-UI configuration options:

           window.ui = SwaggerUIBundle({
               url: "${openapi_json_path}",
               dom_id: "#swagger-ui",
               deepLinking: true,
               defaultModelsExpandDepth: 1,
               defaultModelExpandDepth: 1,
               docExpansion: "list",
               validatorUrl: false,
               presets: [
                   SwaggerUIBundle.presets.apis,
               ],
               plugins: [
                   SwaggerUIBundle.plugins.DownloadUrl
               ],
               tagsSorter: "alpha",
               apisSorter : "alpha",
               operationsSorter: "alpha",
           });

Is your feature request related to a problem?

As shown below, the */* is incorrectly converted into <em>/</em> instead of the expected */*.
Furthermore, the rendering is not that great (code style like paths would be better).

Image

Using the "Try it out" view, the value is correctly */*, so it seems an issue just on the preview of values.

Image

Describe the solution you'd like

It should render similar to what redoc does, which makes interpretation clearer.
It should also ensure proper wraping of the values.

Image

Describe alternatives you've considered

Custom CSS. However, that still doesn't fix the invalid */* value.

The CSS does not allow much flexibility either given how the HTML is generated with broad classes (ie: the enum is pre-concatenated a one comma-separated list of values).

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions