Skip to content

Using "content" in "parameters" doesn't work #4937

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

Closed
piotrzarzycki21 opened this issue Oct 11, 2018 · 2 comments
Closed

Using "content" in "parameters" doesn't work #4937

piotrzarzycki21 opened this issue Oct 11, 2018 · 2 comments

Comments

@piotrzarzycki21
Copy link

Q&A (please complete the following information)

  • OS: Windows 10 64bit
  • Browser: Chrome
  • Version: 69.0.3497.100 (Official Build) (64-bit)
  • Method of installation: dist
  • Swagger-UI version: 3.19.3
  • Swagger/OpenAPI version: OpenAPI 3.0.1

Content & configuration

Example Swagger/OpenAPI definition:

"/myapi/mymethod": {
      "post": {
        "summary": "My Method.",
        "operationId": "myapimymethod",
        "tags": [
          "common"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "params",
            "required": "true",
            "description": "Additional data for document",
            "content": {
                "application/json":{
                  "schema": {
                      "type": "object",
                      "properties": {
                          "firstname": {
                            "type": "string"
                          }
                      }
                  }
              }
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                    "$ref": "./schemas/body/somedata.json#/somedata"
                }
              }
            }
        }
    }

Swagger-UI configuration options:

const ui = SwaggerUIBundle({
        url: "common.json",
        dom_id: '#swagger-ui',
        deepLinking: true,
        presets: [
          SwaggerUIBundle.presets.apis,
          SwaggerUIStandalonePreset
        ],
        plugins: [
          SwaggerUIBundle.plugins.DownloadUrl
        ],
        layout: "StandaloneLayout"
      })

Describe the bug you're encountering

I'm getting following results when content is being used in API description:
cannot_read

Open API documentation describing that I can use content inside parameters - section schema vs content

To reproduce...

Steps to reproduce the behavior:
Run in Swagger UI provided example.

Expected behavior

Work as it is described in OpenApi documentation.

Screenshots

You will get following results.
could_not_render

@hkosova
Copy link
Contributor

hkosova commented Oct 11, 2018

Thanks for the report! This issue is being tracked in #4442.

@shockey
Copy link
Contributor

shockey commented Oct 11, 2018

Closing as a duplicate of #4442.

@shockey shockey closed this as completed Oct 11, 2018
@lock lock bot locked and limited conversation to collaborators Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants