Post method on Swagger

Not applicable

Can anyone tell me how to add json/xml body for POST calls on swagger????

0 1 836
1 REPLY 1

Not applicable

You can reference the schema in the parameters section, then in the definitions section you can specify the JSON object. Example parameter definition:

parameters:
  - name: requestBody
    in: body
    description: 'request body'
    required: true
    schema:
      $ref: '#/definitions/requestBody'