swagger-api / swagger-api/swagger-ui

Nested schemas do not show description in swagger-ui

Open
#5,139 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  • OS: macOS 10.14
  • Browser: Safari
  • Version: 12.0
  • Method of installation: Github download
  • Swagger-UI version: 3.20.5
  • Swagger/OpenAPI version: Swagger 2.0

The following snippet of Swagger JSON from my API includes a description for a nested property:

"reasonForDeletion":{"description":"The reason for deletion. VocabularyDomain=SubjectMgmtAllergyDeletionReason.","$ref":"#/definitions/CodedConceptReference"}}

The Swagger-ui output, however, does not display the nested entity description i.e.: it looks like this:
image

Steps to reproduce the behavior:

  1. Use Swagger-UI to explore an API with a nested property having a description
  2. Expand the nested property
  3. Observe a lack of the 'description' text

Expected behaviour:
Descriptions of nested properties should appear immediately adjacent to the described property; the nested entity descriptions should then follow

Additional context or thoughts

  • this problem has existed in every version of Swagger-UI going back well over a year. It has been reported several times, and described as 'fixed' several times as well

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 reproducing the issue in Swagger UI 3.20.5 with the supplied Swagger 2.0 JSON and inspect the nested-property rendering path. Done means the description for reasonForDeletion appears adjacent to that property when it is expanded, including a regression check for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
documentation, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.