Skip to content

api-commons/problem-details-for-http-apis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Problem Details for HTTP APIs

A reusable base for applying Problem Details for HTTP APIs to your own API. Problem Details is a standardized way to carry machine-readable error information in an HTTP response — a type, title, detail, instance, and status — so producers and consumers can share one predictable error format instead of every API inventing its own.

This base was originally developed by Bump.sh as part of their Train Travel API template (also published in the commons as train-travel). Here it is reduced to just the Problem Details components on their own, so you can drop the pattern into any API and reuse it across your surface.

What's in this repo

  • openapi.yml — An OpenAPI 3.1.0 base that defines a Problem schema plus ready-to-reuse 4xx/5xx responses (BadRequest, Unauthorized, Forbidden, NotFound, Conflict, TooManyRequests, InternalServerError), each returning application/problem+json and application/problem+xml, along with RateLimit and Retry-After headers. Fork it and reference these components from your own OpenAPI.

Links

How it fits API Commons

Problem Details is an API Commons building block — a small, machine-readable pattern you can reuse across the APIs you produce so error handling stays consistent and interoperable across documentation, mocking, and testing tools.

Support

If you have any questions feel free to submit an issue on this repository, engage directly with the IETF RFC, or contact Bump.sh about their Train Travel API and services.

Part of API Commons

A machine-readable building block from API Commons — open specifications and schemas for the APIs you produce and consume. See all building blocks and tools at apicommons.org and the tools at apicommons.org/tools.

Related building blocks

  • train-travel — the Bump.sh Train Travel API template this base was drawn from
  • json-api — JSON:API schemas and governance for standardizing API responses
  • examples — shared request/response examples for API operations

About

This is a base for using Problem Details for HTTP APIs in your API.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors