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.

Swagger-UI can't render `content` inside a parameter

See original GitHub issue
Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 3.0.0
Which Swagger-UI version? v3.13.4
How did you install Swagger-UI? standalone-dist
Which browser & version? Firefox 61.0a1
Which operating system? Mac Sierra

Demonstration API definition

Try and add a query parameter referencing an object (which according to the spec is a valid thing to do)

        - name: users
          in: query
          description: List of users to query for
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserArray"

components:
  schemas:

    UserArray:
      type: array
      items:
        $ref: "#/components/schemas/User"

    User:
      required:
        - userId
        - currency
      properties:
        userId:
          type: integer
          format: int32
        currency:
          type: string

Configuration (browser query string, constructor, config.yaml)

I am using no additional config options, everything is vanilla.

Expected Behavior

The UI should offer me a nice way of typing in arrays of objects in a query param. According to the documentation this should be possible:

in: query
name: coordinates
content:
  application/json:
    schema:
      type: object
      required:
        - lat
        - long
      properties:
        lat:
          type: number
        long:
          type: number

Current Behavior

Screen_Shot_2018_04_14_at_19_25_39

Context

Just an honest labourer trying to document a horrendous API I didn’t write 🤣

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:14
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

15reactions
vinhlhcommented, May 21, 2019

@shockey do you guys have any plan to support this? Or is there any chance that we can help/ contribute.

12reactions
ksac1commented, Mar 28, 2019

@vinhlh : Yes, just follow the way of writing the path parameters and query parameters on the link: https://swagger.io/docs/specification/describing-parameters/

It really worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

asp.net - Swagger UI doesn't render body parameter field for ...
My GET action is working fine when testing from Postman and filling the json in the body of the request. By setting breakpoint...
Read more >
Issue with JSON content in query parameter
when i open this schema in swagger UI , it doesnt render JSON query parameters. ( Could not render this component,...
Read more >
Enriched Web API Documentation using Swagger/OpenAPI in ...
API Documentation generation tools (e.g., Swagger UI, Redoc, etc.) to render our OpenAPI definition (e.g., as a web page).
Read more >
Swagger documentation customisation | Europe PMC Tech Blog
This is a callback function parameter which can be passed to be notified of when SwaggerUI encountered a failure was unable to render....
Read more >
Using OpenAPI and Swagger UI - Quarkus
The solution is located in the openapi-swaggerui-quickstart directory. ... You can request the OpenAPI in JSON format using the format query parameter.
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