liveBook · Manning

RFC 9457

As explained in The Design of Web APIs, Second Edition

Problem Details for HTTP APIs is a standardized error-response format for communicating machine-readable and human-readable details about an HTTP error.

RFC 9457 standardizes Problem Details for HTTP APIs: an error-response format that communicates machine-readable and human-readable information. It uses application/problem+json so consumers can identify the format precisely, while allowing custom properties for domain-specific needs. section 9.8.6

A problem detail commonly distinguishes:

  • status, the returned HTTP status; section 9.8.6
  • type, identifying the problem and optionally linking to further information; section 9.8.6
  • title and detail, providing stable and occurrence-specific human-readable explanations; section 9.8.6
  • custom properties such as an errors list for validation or business-rule failures. section 9.11 section 9.8.6

Money transfer and unexpected server errors

A money-transfer operation can return a Problem Details response with an errors list whose entries use detail and type consistently with the standard. For an unexpected failure, return a generic message and optionally use instance, such as /unexpected-errors/12345, to correlate the response with server investigation without exposing database, network, or programming-language details. section 9.8.6 section 12.10.3

Figure 9.15 An error response for the “Money transfer” operation using and customizing the “Problem Details for HTTP APIs” standard
figure

Inspect the money-transfer response example to see standard properties combined with a custom errors list. section 9.8.6

How The Design of Web APIs, Second Edition covers it

How deep it goes
Defines core properties, media types, translations, extensions, and security considerations, while directing readers to the full standard for more detail.
Examples
Uses money-transfer validation errors and generic unexpected-server errors with opaque investigation references.
What it assumes
Assumes familiarity with HTTP API operations and status codes while clarifying the structure of standardized error feedback.
What you can do after
Apply RFC 9457 to return consistent error responses and safer diagnostics across HTTP API operations.
How it connects
Connects HTTP status codes, validation, business rules, content types, error handling, and information-disclosure security.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Design of Web APIs, Second Edition. The section links point to the parts of the book it draws on.