Documentation

Unsupported media type

The request Content-Type is missing, invalid, or does not match the operation's selected request media type.

Last reviewed October 27, 2026

Problem identity

HTTP status: 415. Stable code: unsupported_media_type.

Type URI: https://openapi-to-rust.dev/problems/unsupported-media-type.

How to respond

Set Content-Type to the operation's selected media type, including any required media type parameters, and encode the body accordingly.

Example response

The response uses application/problem+json. This is an illustrative body; individual violations depend on the request.

Response body json
{
  "type": "https://openapi-to-rust.dev/problems/unsupported-media-type",
  "title": "Unsupported media type",
  "status": 415,
  "code": "unsupported_media_type"
}

Error fields

type identifies the problem category, title summarizes it, status mirrors the HTTP status, and code is a stable machine-readable label. The optional errors array contains sanitized code, location, and message fields. Empty arrays are omitted.

Locations are JSON Pointers rooted at /body, /path, /query, /header, or /cookie. Violations are deduplicated, capped (16 by default), then sorted. Messages omit submitted values and internal diagnostics.

Clients can use the type URI as an identifier without fetching this page for every error. See RFC 9457, section 3.1.1.

Related documentation