Skip to content

"body parameter" example in 3.x does not fit how Request Body Objects work #3761

Closed
@handrews

Description

@handrews

In the Request Body Examples section of both 3.0 and 3.1, the second example is as follows (JSON omitted for brevity):


A body parameter that is an array of string values:

description: user to add to the system
required: true
content:
  text/plain:
    schema:
      type: array
      items:
        type: string

This is identical to an example in the 2.0 spec, where the request body was treated as a parameter. I'm not entirely sure how it was supposed to be serialized even there, as the 3.x style and explode fields don't exist, but I definitely don't see how to serialize it in 3.0. There is no JSON Schema data model defined for text/plain, and nothing in the Request Body Object talks about how to serialize a list of values into plain text (Is it a comma-separated list? Is it one value per line?)

What was this example trying to show, and how can we show it more clearly?

Metadata

Metadata

Assignees

Labels

bugexamplesrequests for more or better examples in the specificationmedia and encodingIssues regarding media type support and how to encode data (outside of query/path params)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions