scottie1984 / swagger-ui-express

Adds middleware to your express app to serve the Swagger UI bound to your Swagger document. This acts as living documentation for your API hosted from within your app.
MIT License
1.42k stars 225 forks source link

Showing requestBody as fillable form when executing request on UI #251

Closed veyselyenilmez closed 2 years ago

veyselyenilmez commented 3 years ago

Hey, When I use "application/x-www-form-urlencoded" content-type under the "requestBody: content:" and click the Try It Out button, the result I get is a fillable form in User Interface. But when I use "application/json" content-type and click the Try It Out button, the result is raw JSON editing in the UI.

The problem is my API only accepts application/json request body.

So is there way to get fillable form in the UI while using the application/json content-type?

Thanks in advance.


post:
  summary: Create user
  description: Creates user according the input data
  requestBody:
    content:
      application/x-www-form-urlencoded:
        schema:
          type: object
          required:
          - active
          - username
          - email
          - password
          properties:
            active:
              type: boolean
              description: ""
            firstname:
              type: string
              description: İsim
              example: John
            lastname:
              type: string
              example: Doe
            username:
              type: string
              description: User Name
              example: johndoe
            password:
              type: string
              description: PassWord
            email:
              type: string
              description: Email Address
              example: johndoe@johndoe.com_
scottie1984 commented 2 years ago

I suggest raising this directly with https://github.com/swagger-api/swagger-ui

veyselyenilmez commented 2 years ago

I suggest raising this directly with https://github.com/swagger-api/swagger-ui

Thank you. My bad.