swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

Display the Model/schema for object and array[object] parameters

Open hkosova opened this issue 6 years ago • 3 comments

This is a follow-up to #3558 and also related to #3641.

As an API consumer, I want to see the schema of object parameters (individual property types, descriptions, etc.), so that I can better understand how to use the API.

Q&A (please complete the following information)

  • OS: any
  • Browser: any
  • Method of installation: dist
  • Swagger-UI version: 3.15.0
  • Swagger/OpenAPI version: OpenAPI 3.0.0

Demonstration API definition

openapi: 3.0.1
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: number
                description: Latitude (north-south position)
                minimum: -90
                maximum: 90
                example: 50
              long:
                type: number
                description: Longitude (west-east position)
                minimum: -180
                maximum: 180
                example: 20
              scale:
                type: integer
                example: 32000
          style: matrix
          explode: true
      responses:
        '200':
          description: OK

Is your feature request related to a problem?

#3558 added a JSON editor for object-type parameters, which is great. However, it requires clicking "try it out" to see a sample object, and even after doing that, the parameter model descriptions and property descriptions are still not displayed anywhere in the UI.

Request bodies and responses have the "Model" tab - can it be reused for object parameters?

object-parameter-schemas

Describe the solution you'd like

Maybe reuse the "Model" component for object parameters?

Describe alternatives you've considered

N/a

Additional context

N/a

hkosova avatar May 22 '18 12:05 hkosova

Hi,

I'm struggling with the same: I want to document a parameter similar to this one of the OIDC spec: https://openid.net/specs/openid-connect-core-1_0.html#ClaimsParameter

So it's a JSON which is URL encoded. Showing the schema as mentioned above would be great - it would unify the behaviour for query params, body and responses.

dirkbolte avatar Mar 13 '20 15:03 dirkbolte

Is there any way to make this issue more noticeable? Because I really want this to be fixed

thmasker avatar May 28 '21 11:05 thmasker

As a stopgap, I added a link to the related schema anchor:

description: '[Schema Name](#model-schema_name_here)'

causztic avatar Jul 29 '22 08:07 causztic