question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Object parameter schemas are not displayed

See original GitHub issue
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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:11
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
spemmonscommented, Jun 5, 2019

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

1reaction
liteultomcommented, Jun 13, 2019

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'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Swagger documentation from XML doesn't show schema for in ...
Using an example of REST api with a GET method that takes in an object query parameter. · VSCode is configured to generate...
Read more >
18 Schema Object Dependency
18 Schema Object Dependency. If the definition of object A references object B, then A depends on B. This chapter explains dependencies among...
Read more >
Describing Parameters - Swagger
In Swagger, API operation parameters are defined under the parameters ... Objects are not supported. ... schema is only used with in: body...
Read more >
Parameter Object - Redocly
A parameter MUST contain either a schema property, or a content property, but not both. When example or examples are provided in conjunction...
Read more >
Solved: How can I define and reference an array of object
Solved: I have a REST endpoint which accepts and Id and an object as input parameter. I have documented it as follows :...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found