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

RequestBody with 'x-www-urlencoded' render error #7210

Closed
wsw0108 opened this issue Apr 26, 2021 · 1 comment
Closed

RequestBody with 'x-www-urlencoded' render error #7210

wsw0108 opened this issue Apr 26, 2021 · 1 comment

Comments

@wsw0108
Copy link

wsw0108 commented Apr 26, 2021

Q&A (please complete the following information)

  • OS: Windows 10
  • Browser: chrome
  • Version: 89
  • Method of installation: dist assets
  • Swagger-UI version: 3.47.1
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.0
info:
  title: "test"
  version: 1.0.0
paths:
  /test:
    post:
      requestBody:
        description: "test"
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Message'
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/Message'
            encoding:
              data:
                contentType: application/json
      responses:
        200:
          description: "OK"
          content:
            application/json:
              schema:
                type: object
components:
  schemas:
    Message:
      type: object
      properties:
        text:
          type: string

Swagger-UI configuration options:
using https://editor.swagger.io/

SwaggerUI({
  // your config options here
})

Describe the bug you're encountering

To reproduce...

Steps to reproduce the behavior:

  1. Click "Try it out" with content type 'application/x-www-form-urlencoded'
  2. See error

Expected behavior

The edit textarea should fill with default value when select content type 'application/json'.

Screenshots

image

image

Additional context or thoughts

@hkosova
Copy link
Contributor

hkosova commented May 20, 2021

Duplicate of #7268.

@hkosova hkosova closed this as completed May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants