request-body-media-type-removed

Request body media-type deleted.

directionrequestarearequestBodykindexistenceactionremove

Breaking change (level: error)

oasdiff reports this as a breaking change by default. It can break existing API clients, so CI fails on it unless you downgrade its severity.

What this check detects

A request body can declare more than one media type under content, for example application/json and application/xml, and a client picks one by setting its Content-Type header. The server accepts whichever media types are listed.

Removing a media type drops the server’s ability to accept requests sent with that Content-Type. Clients that were sending the removed format have no compatible alternative and break, which is why this is reported as a breaking change.

Example

Before
requestBody:
  content:
    application/json:
      schema:
        $ref: '#/components/schemas/Pet'
    application/xml:
      schema:
        $ref: '#/components/schemas/Pet'
After
requestBody:
  content:
    application/json:
      schema:
        $ref: '#/components/schemas/Pet'

The "application/xml" media type was removed from the request body. Clients that send XML bodies break.

Change its severity or ignore it

To change the severity oasdiff assigns to request-body-media-type-removed, list its id and a level in a severity-levels file, one rule per line. The level can be err, warn, or info, or none to disable the check entirely:

# severity.txt
request-body-media-type-removed warn

Then pass it to oasdiff:

oasdiff changelog base.yaml revision.yaml --severity-levels severity.txt

Setting the level to none disables the check, so it is no longer reported at all.

Related requestBody rules

Browse all 500 checks →