Skip to content

OAS 3.0 Form Data Try-It-Out object serialization #3788

@shockey

Description

@shockey
Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 3.0.0
Which Swagger-UI version? 3.3.2
Which browser & version? Chrome 61
Which operating system? macOS High Sierra

Demonstration API definition

openapi: '3.0.0'
info:
  version: 1.0.0
  title: blah
servers:
- url: /
paths:
  /:
    post:
      description: asdf
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                address:
                  # complex types are stringified to support RFC 1866
                  type: object
                  properties: {}
      responses:
        200:
          description: OK

Expected Behavior

I expect my request body value, shown below, to be serialized correctly.

{
  "id": "string",
  "address": {}
}

Current Behavior

The address object is not properly serialized before the request is sent:

messages image 4135647482

Possible Solution

Non-primitive values should be serialized correctly, here: https://github.com/swagger-api/swagger-js/blob/2a3f113c1c219ec3756a73ffc35e366987ff6f5c/src/execute/oas3/build-request.js#L47

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions