Skip to main content

EOAP Problems Registry

PyPI - Version PyPI - Python Version GitHub Actions Workflow Status Code coverage

EOAP Problems Registry is a shared registry of API problem detail types for EOAP services. The problem responses conform to RFC 9457, formerly RFC 7807, and are published as documentation, JSON Schema/OpenAPI artifacts, and a Python package with generated Pydantic models.

The registry is intended to give API providers and consumers a common vocabulary for reusable application/problem+json responses.

What Is Included

  • schemas/schema.yaml: JSON Schema definitions for the common ProblemDetails, ErrorDetail, and each registered EOAP problem type.
  • schemas/openapi.yaml: reusable OpenAPI 3.1 response components and examples that reference the JSON Schema definitions.
  • src/eoap_problems_registry: generated Pydantic models for the registry.
  • docs/: MkDocs pages for each problem type, plus generated JSON Schema and OpenAPI documentation.
  • tests/: unit tests that verify generated problem models and extension behavior.
  • .github/workflows/: documentation deployment, package CI, and PyPI release automation.

Registered Problems

EOAP-specific problem types:

Problem type HTTP status
Already Exists 409
Business Rule Violation 422
Invalid Body Property Format 400
Invalid Body Property Value 400
Invalid Request Header Format 400
Invalid Request Parameter Format 400
Invalid Request Parameter Value 400
Invalid State Transition 422
Missing Body Property 400
Missing Request Header 400
Missing Request Parameter 400
License Expired 503
License Cancelled 503
Validation Error 422

Common convenience problem types:

Problem type HTTP status
Bad Request 400
Conflict 409
Failed Dependency 424
Forbidden 403
Gone 410
Insufficient Storage 507
Invalid Parameters 400
Method Not Allowed 405
Not Acceptable 406
Not Found 404
Not Implemented 501
Request Timeout 408
Server Error 500
Service Unavailable 503
Unauthorized 401
Unavailable For Legal Reasons 451
Unprocessable Content 422

For generic/common HTTP problem types, prefer the IANA HTTP Problem Types registry when it fits your use case.

Python Usage

Install the package in an environment with Pydantic 2:

pip install eoap-problems-registry

Use the generated models to build responses with fixed registry fields and optional extension members:

import eoap_problems_registry as registry

problem = registry.MissingRequestParameter(
    instance="https://api.example.test/problems/abc123",
    code="400-03",
    errors=[
        registry.ErrorDetail(
            detail="The query parameter limit is required.",
            parameter="limit",
        )
    ],
)

payload = problem.model_dump(mode="json", exclude_none=True)

The resulting payload includes the registered type, status, title, and detail values:

{
  "instance": "https://api.example.test/problems/abc123",
  "code": "400-03",
  "errors": [
    {
      "detail": "The query parameter limit is required.",
      "parameter": "limit"
    }
  ],
  "type": "https://eoap.github.io/problems-registry/missing-request-parameter",
  "status": 400,
  "title": "Missing request parameter",
  "detail": "The request is missing an expected query or path parameter.",
}

ProblemDetails and ErrorDetail allow additional provider-specific fields, while generated problem classes use Pydantic literal fields to protect the registered type, status, title, and detail values.

FastAPI Integration

The optional FastAPI integration requires Python 3.10 or newer. Install it with the fastapi extra:

pip install "eoap-problems-registry[fastapi]"

Register an exception handler that returns the problem detail as the response body, then raise ProblemRegistryException from a route:

from fastapi import FastAPI

import eoap_problems_registry as registry
from eoap_problems_registry.fastapi import ProblemRegistryException

app = FastAPI()


@app.get("/resources/{resource_id}")
async def get_resource(resource_id: str) -> dict[str, str]:
    raise ProblemRegistryException(
        problem=registry.NotFound(
            instance=f"https://api.example.test/resources/{resource_id}",
        )
    )

Schemas And OpenAPI

Use the schema and OpenAPI files directly when integrating the registry into API descriptions:

When a response needs more context, include an errors array. Each item must contain detail and may include pointer, parameter, header, code, or provider-specific extension fields.

Development

This repository uses Hatch for Python environments, Ruff for formatting/linting, MkDocs for documentation, and Taskfile tasks for generated artifacts.

Useful commands:

hatch run test:test
hatch run test:testv
hatch run test:cov
hatch run dev:lint
hatch run dev:check
task process_schema
task generate_openapi_docs
task serve_docs

task process_schema regenerates the Pydantic models in src/eoap_problems_registry/__init__.py and the JSON Schema documentation in docs/json-schema.md.

task generate_openapi_docs regenerates the static OpenAPI documentation under docs/openapi/.

task serve_docs starts the MkDocs site locally.

Contributing Problem Types

To add or update a problem type:

  1. Update schemas/schema.yaml with the JSON Schema definition under $defs.
  2. Update schemas/openapi.yaml if the problem should be exposed through reusable OpenAPI response components or examples.
  3. Add or update the matching Markdown page in docs/.
  4. Add the page to the nav section in mkdocs.yaml.
  5. Run task process_schema to regenerate the Python models and schema docs.
  6. Run task generate_openapi_docs if OpenAPI components or examples changed.
  7. Add or update tests in tests/ when generated behavior changes.
  8. Run the test and lint commands before opening a pull request.

Problem type URIs should use the published registry base URL:

https://eoap.github.io/problems-registry/{problem-name}

Use hyphen-separated names for problem page filenames and URI suffixes, for example missing-body-property.

CI And Releases

The package workflow runs Ruff and the unit test suite on Python 3.10 through 3.14 for pushes and pull requests targeting the active development branches. Version tags matching v*.*.* build and publish the package to PyPI after verifying that the tag version matches hatch version.

The docs workflow publishes the MkDocs site to GitHub Pages when documentation-related files change on docs, develop, or main.

License

Apache License, Version 2.0

Metadata

Release files for eoap-problems-registry 1.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eoap-problems-registry 1.7.0
File Size Uploaded
eoap_problems_registry-1.7.0.tar.gz 113.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eoap-problems-registry 1.7.0
File Interpreter ABI Platform
eoap_problems_registry-1.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 128.7 kB

Release files / eoap_problems_registry-1.7.0.tar.gz

Download URL eoap_problems_registry-1.7.0.tar.gz
Size 113.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0337fea69cf7e18a5e77fa62aa3d1bd1413d06c0cb69e872c892526542c8f066
BLAKE2b-256 checksum
How to use checksums
c6deda30c6364585d56be5de62b50bc9773111f9eef288e4044d40ab19bf213a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / eoap_problems_registry-1.7.0-py3-none-any.whl

Download URL eoap_problems_registry-1.7.0-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a01e925a126a620911d9cad9f77d70ee2427bdd2f59133c78f4d1ee00fe44be
BLAKE2b-256 checksum
How to use checksums
a6a24cf7dd5519cee369b77628002f4cbf14ce0ab4fd819ea61f6db276e7606d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

1.8.0

2 release files

This release

1.7.0 This release

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page