Swagger-ui: Object parameter schemas are not displayed

Created on 11 Aug 2017  路  6Comments  路  Source: swagger-api/swagger-ui

| Q | A
| ------------------------------- | -------
| Bug or feature request? | Bug
| Which Swagger/OpenAPI version? | 3.0.0
| Which Swagger-UI version? | 3.1 series
| How did you install Swagger-UI? | n/a
| Which broswer & version? | Chrome
| Which operating system? | macOS Sierra

First reported here:https://github.com/swagger-api/swagger-ui/issues/3428#issuecomment-319040200

Demonstration API definition


openapi: 3.0.0
info:
  version: 0.0.0
  title: test

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

paths:
  /anything/foo{params}:
    get:
      parameters:
        - in: path
          name: params
          required: true
          schema:
            type: object
            properties:
              lat:
                type: integer
                example: 50
              long:
                type: integer
                example: 20
              scale:
                type: integer
                example: 32000
          style: matrix
          explode: true
      responses:
        '200':
          description: OK

Expected Behavior


Object parameter schemas should be displayed similar to Request Bodies.

Current Behavior


Object schema is not displayed at all.

Possible Solution


Request Body display component may need to be generalized and reused.

P1 lock-bot 3.x bug 3.x

Most helpful comment

would be great to get this going ... is there a known solution that nobody has had time to implement? ... could take a whack at it w/ guidance

All 6 comments

@shockey it's slightly more than that - parameters also support content, even though only one media type can be used.

Any update on this? Appears there's no way to currently display complex query objects w/o this part of OAS 3.0.

@ctruzzi you are correct! PRs are welcome.

This was fixed by #4563 馃槃

image

would be great to get this going ... is there a known solution that nobody has had time to implement? ... could take a whack at it w/ guidance

This does not work if the schema is given through $ref :

Does not work:

    /table/{tableName}:
      get:
        parameters:
         - in: path
           name: tableName
           required: true
           schema:
             $ref: "/api/v1/conso/schemas/enums/tableNames"

with /api/v1/conso/schemas/enums/tableNames returning:

{
    type: 'string',
    enum: ['hello', 'there'],
    default: 'there'
}

Works:

     /table/{tableName}:
       get:
         parameters:
          - in: path
            name: tableName
            required: true
            schema:
              type: string
              enum: ['hello','there']
              default: 'there'
Was this page helpful?
0 / 5 - 0 ratings

Related issues

insideshell picture insideshell  路  3Comments

easyest picture easyest  路  3Comments

Deraen picture Deraen  路  4Comments

zilongl picture zilongl  路  3Comments

fehguy picture fehguy  路  3Comments