Skip to content

P2: no status pinned for wrong Content-Type -- pin 415, register unsupported_media_type #7

Description

@ssilvius

Severity: P2. Reviewed at 82b715c.

S2 (SPEC.md:24) requires Content-Type: application/json on requests but never says what a server does when it gets something else. The conformance suite shrugs at the gap rather than closing it:

| R-4 | Content-Type other than application/json | 400 or 415 |

"400 or 415" is not a conformance assertion -- a client cannot branch on it, and two conforming servers can disagree.

Fix: pin 415, register unsupported_media_type

415 is the correct HTTP status for this condition, and none of the eight currently registered error codes fits: bad_request is about the request body, and conflating a malformed body with an unacceptable media type loses the distinction a client needs to retry correctly (fix your headers vs. fix your payload).

Per S11, adding an error code is an additive minor change, so this is in scope for a v0.1.x revision rather than requiring a major.

Acceptance

  • S2 states the required response for a non-JSON Content-Type: 415 with error.code = unsupported_media_type.
  • unsupported_media_type added to the S7 registered code table with HTTP 415.
  • Conformance R-4 expects 415 specifically, not "400 or 415".
  • Both reference servers emit it.

Origin: codex spec review, verified against SPEC.md:24 and conformance/README.md R-4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions