swagger-api / swagger-api/swagger-ui

Object description not rendered correctly

Open
#4,030 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 3.0
Which Swagger-UI version? Latest docker
How did you install Swagger-UI? Docker
Which browser & version? Chrome 62.0.3202.94
Which operating system? macOS Sierra 10.12.6
Demonstration API definition
openapi: "3.0.0"
info:
  description: "Object Description Demo"
  version: "1.0.0"
  title: "Object Description Demo"
  termsOfService: ""
  contact:
    email: "author@example.com"
  license:
    name: "UNLICENSED"

servers:
  - url: "v1/"

paths:
 /foo:
  get:
    responses:
      204:
        description: OK
  

components:
  schemas:
    MyObject:
      description: Hello, world!
      type: object
      properties:
        foo:
          type: string
      
Configuration (browser query string, constructor, config.yaml)

N/A - Specifying json spec via docker env variable SWAGGER_JSON

Expected Behavior

Description should render without description: label in dark text instead of gray text like it does in other places such as:

image

It (probably?) also belongs outside of the object braces so that it does not disappear when the object is collapsed.

Current Behavior

image

Possible Solution
Context

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

Start by loading the supplied OpenAPI 3.0 schema in Swagger UI and inspect the frontend rendering path for object schema descriptions. Compare the displayed description with descriptions in other schema contexts and test the collapsed-object behavior. Done means the description uses the expected dark styling, omits the description: label, and remains visible when the object is collapsed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.