Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Required' in a schema that refs another schema doesn't render #4000

Closed
nahun opened this issue Dec 7, 2017 · 0 comments · Fixed by swagger-api/swagger-js#1201
Closed

'Required' in a schema that refs another schema doesn't render #4000

nahun opened this issue Dec 7, 2017 · 0 comments · Fixed by swagger-api/swagger-js#1201

Comments

@nahun
Copy link

nahun commented Dec 7, 2017

Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 3.0.0
Which Swagger-UI version? 3.6.0
How did you install Swagger-UI? Run index.html in browser
Which browser & version? Latest Chrome
Which operating system? Ubuntu 16.04

Demonstration API definition

openapi: 3.0.0
info:
  version: 1.0.0
  title: test

servers:
  - url: http://httpbin.org

paths:
  /anything:
    get:
      responses:
        '200':
          description: test
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    example: myname
                  jobs:
                    $ref: '#/components/schemas/listitems'
components:
  schemas:
    listitems:
      type: object
      required:
        - item
      properties:
        item:
          $ref: '#/components/schemas/item'
    item:
      type: string
      example: hi

Expected Behavior

The response schema should render all the properties

Current Behavior

It doesn't render much of anything
required_render

Possible Solution

Remove 'required' from the 'listitems' schema
required_render_good

Comments

This works in Swagger Hub without issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants