swagger-api / swagger-api/swagger-ui

Property of type array has description shown incorrectly

Open
#4,001 2 comments 2 reactions 1 assignee View on GitHub

@shockey is already working on this.

Since Dec 8, 2017.

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

Description

This is a representation issue. All the data is in place, only in a wrong place.

Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 3.0.0
Which Swagger-UI version? Version not shown
How did you install Swagger-UI? Online
Which browser & version? Chrome 62
Which operating system? Windows
Demonstration API definition

Create a schema object that has a property of type array. Put a description on that property. See example below:

openapi: 3.0.0
info:
  title: Test
  version: 1.0.0

paths:
 '/':
   get:
     responses:
       200:
         description: OK

components:
  schemas:
    Collection:
      type: object
      properties:
        items:
          description: Children items
          type: array
          items:
            type: string
Expected Behavior

The property description is shown below the array type:

[
string]
Children items
Current Behavior

The property description is shown inside the array type and disappears when the array type is collapsed:

[
Children items
string]

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.