Core Concepts

Problem JSON (RFC 7807)

Standardized error responses with type, title, status, and detail.

Problem JSON (RFC 7807)

Bklar supports RFC 7807 Problem Details for HTTP APIs. Enable it via the errorFormat option.

Configuration

const app = Bklar({
  errorFormat: "problemJson",
});

Response Format

With problemJson enabled, error responses use the standard structure:

{
  "type": "https://httpstatuses.io/404",
  "title": "Resource not found",
  "status": 404,
  "detail": "User not found"
}
FieldDescription
typeURI identifying the problem type
titleShort human-readable summary
statusHTTP status code
detailHuman-readable explanation

The default format ("basic") returns { "message": "..." } instead.

On this page