Forum Discussion

markathomas's avatar
markathomas
New Contributor
6 years ago

What's wrong with this request body definition

I followed the example at https://swagger.io/docs/specification/2-0/describing-request-body/ and Swagger Editor is saying it's invalid for 2.0 API spec.  Here's the def: [ Spoiler ]  
  • RonRatovsky's avatar
    RonRatovsky
    6 years ago

    Change your body parameter to this:

          - in: body
            name: request
            schema:
              $ref: '#/definitions/CreateRoomRequest'
            required: true

    Body parameters do not have 'type' in them.