Skip to content

ImATeapot (418) problem details use the type, title, and detail of a 500 #95

Open

Description

@feO2x

Problem

ErrorCategory.ImATeapot (418) is missing from the switch expressions of GetTypeUri, GetTitle, and GetDetail in src/Light.PortableResults/Http/ErrorCategoryExtensionsForHttp.cs, so all three fall back to their default arms.

ToHttpStatusCode() correctly returns 418. A failed result whose leading category is ImATeapot therefore produces a 418 response, but the Problem Details carry the values of a 500:

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
  "title": "Internal Server Error",
  "status": 418,
  "detail": "An unexpected error occurred."
}

Expected

ImATeapot gets its own type URI (RFC 9110 section 15.5.19), title (I'm a teapot), and detail. A test should cover that every defined ErrorCategory member has a dedicated entry in all three methods, so that future categories cannot fall through to the defaults unnoticed.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions