Forum Discussion

johndorazio's avatar
johndorazio
New Contributor
5 years ago

In a POST operation, is it possible to have multiple examples for each property in the requestBody ?

Reading over the swagger documentation, it seems to me like the `properties` in the `requestBody` of a `POST` operation are much more limited than the `parameters` of a `GET` operation.   In my API...
  • HKosova's avatar
    5 years ago

    Hi johndorazio,

    Your understanding is correct.

    Multiple examples per property will be supported in the next version of the spec, OpenAPI 3.1 (which is in the RC stage now). The syntax will be as follows:

    type: object
    properties:
      id:
        type: integer
        examples:
          - 1
          - 15
      username:
        type: string
        examples:
          - guest
          - john
          - jane