Documentation

Request validation failed

A required input is missing, or a decoded value violates the operation's OpenAPI schema. Constraints can include length, range, enum, and pattern.

Last reviewed October 27, 2026

Problem identity

HTTP status: 422. Stable code: request_validation_failed.

Type URI: https://openapi-to-rust.dev/problems/validation.

How to respond

Use each violation's location and code to correct the input against the OpenAPI schema. Missing inputs use the required violation code.

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/validation",
  "title": "Request validation failed",
  "status": 422,
  "code": "request_validation_failed",
  "errors": [
    {
      "code": "required",
      "location": "/body/name",
      "message": "is required"
    }
  ]
}

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