Skip to content

Support for request body with arbitrary Content-Type (OpenAPI.Next) #882

Closed

Description

@lucafavatella

When attempting to describe a PUT request with arbitrary request body and Content-Type (think about a file upload server where you can choose the Content-Type), a "default" catch-all Content-Type needs to be added to content object.

I understand that request with arbitrary body and Content-Type cannot be specified in OpenAPI 2.0 (file type has restrictions on Content-Type).

Activity

  1. webron commented on Feb 7, 2017

    @webron
    Member

    This has been resolved in #878.

  2. lucafavatella commented on Feb 8, 2017

    @lucafavatella
    Author

    I see an example of request body in https://github.com/OAI/OpenAPI-Specification/blob/17a389a2e3150c3b10a105e461b73666b2e560e0/versions/3.0.md#requestBodyObject has a "*" section that looks what I wanted. Thanks.

    {
      "description": "user to add to the system",
      "content" : {
        "application/json" : {
          "schema": {
              "$ref": "#/definitions/User"
            },
          "examples": [
            { "$ref": 'http://foo.bar#/examples/address-example.json'}
          ]
        },
    ...
        "*": {
          "example": {
            $ref: "http://foo.bar#/examples/address-example.whatever"
          }
      }
    }
    
  3. webron commented on Feb 8, 2017

    @webron
    Member

    The example should actually be */* but, the idea is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions