swagger-api / swagger-api/swagger-ui

Styling issues for OAS 3.1

Open
#10,316 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)
  • OS: macOS
  • Browser: chrome
  • Version: 133
  • Method of installation: npm
  • Swagger-UI version: 5.19.0
  • Swagger/OpenAPI version: OpenAPI 3.1
Content & configuration

Example Swagger/OpenAPI definition:

{
    "openapi": "3.1.0",
    "info": {
        "title": "Upload JSON object API",
        "summary": "A brief summary of the Sample API.",
        "version": "1.0.0"
    },
    "paths": {
        "/example": {
            "head": {
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "exampleField": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful response"
                    }
                }
            }
        }
    }
}

Swagger-UI configuration options:

SwaggerUI({
        spec: apiSpec,
        defaultModelsExpandDepth: -1,
        dom_id: '#api-ui-container',
        defaultModelRendering: 'model',
        showExtensions: true,
        deepLinking: true,
        plugins: [DisableTryItOutPlugin],
        onComplete(): void {
          setTimeout(() => that.swaggerUiOnComplete(that), 1000);
        },
      })
Describe the bug you're encountering

There are styling issues observed in the response schema section.

Image
Expected behavior
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the response schema styling with the supplied OpenAPI 3.1 example and SwaggerUI configuration, then compare the result with the attached expected screenshot. Identify the relevant Swagger UI styling or response-schema entry point from the rendered page; done means the response schema presentation matches the expected appearance.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.