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

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

Open
hkosova opened this issue May 22, 2018 · 3 comments · May be fixed by #10166
Open

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

hkosova opened this issue May 22, 2018 · 3 comments · May be fixed by #10166

Comments

@hkosova
Copy link
Contributor

hkosova commented May 22, 2018

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

@dirkbolte
Copy link

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.

@hkosova hkosova changed the title Display the Model/schema for object parameters Display the Model/schema for object and array[object] parameters Sep 8, 2020
@thmasker
Copy link

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

@causztic
Copy link

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

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

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

Successfully merging a pull request may close this issue.

5 participants