Skip to content

Bad schema rendering for primitive values in OAS 3.0 #3500

@LMnet

Description

@LMnet

For OAS 3.0 rendering of primitive values (not object or array) in the schema somehow broken:

  1. The schema doesn't have a name.
  2. Any usages of the schema with the primitive value inside another schema leaves blank space.

Rendering screenshot: http://imgur.com/IJdpWlk

Reproducible for both swagger-editor and standalone swagger-ui.

Swagger version:

{
  "swaggerEditor": "3.1.0/g66e6130-dirty",
  "swaggerUi": {
    "buildTimestamp": "Sat, 29 Jul 2017 19:20:17 GMT",
    "gitDirty": false,
    "gitRevision": "g0f7fa1f",
    "machine": "testing-gce-6bc5f0a0-dfd8-49cf-a163-82f7473df464",
    "version": "3.1.0"
  }
}

Minimal reproducible config:

openapi: "3.0.0"
info:
  version: 1.0.0
  title: Test
paths:
  /test:
    get:
      responses:
        200:
          description: test
components:
  schemas:
    primitive:
      type: integer
      format: int64
    array-of-primitives:
      type: array
      items: 
        - $ref: '#/components/schemas/primitive'
      default: [1]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions