Skip to content

ProblemDetails.Status not populated on error responses #253

Description

@inghamc

The ProblemDetails bodies produced by the result→HTTP conversions omit the Status member for several statuses, so the JSON body's status is null even though the HTTP status code on the response is correct. It is also applied inconsistently — some builders set it, others don't — and RFC 7807 §3.1 says the status member SHOULD be present and match the actual HTTP status code.

Result status Minimal API (MinimalApiResultExtensions) MVC (ResultStatusMap)
422 Error / 404 NotFound / 409 Conflict missing missing
500 CriticalError / 503 Unavailable set missing
403 Forbidden / 401 Unauthorized set n/a (status code only, no body)

This matters to clients that read status off the parsed body (e.g. generated clients that throw the parsed ProblemDetails), where the HTTP status code is otherwise not readily available.

Happy to open a PR.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions