Skip to content

Problem details title should not be automatically filled with a default value #62562

Open
@bill-poole

Description

@bill-poole

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

The problem details RFC (9457) states that the "type" member contains a URI reference that identifies the problem type and that the "title" member is a JSON string containing a short, human-readable summary of the problem type. This implies that different problem types should have different titles. Therefore, a problem details response with a different "type" URI should have a different "title" to describe the different problem type.

However, the default behavior of ASP.NET Core is to populate the "title" member with a default value based on the status code if it is given as null by the endpoint - e.g., "Unprocessable Entity" for status code 422. This results in all "type" URIs with the same status code having the same "title".

The "title" member is optional according to RFC 9457, which states the "title" string is advisory and is included only for users who are unaware of and cannot discover the semantics of the type URI (e.g., during offline log analysis). Therefore, one could argue it would be more "correct" for ASP.NET Core to omit the "title" member if a specific "type" URI is provided.

Describe the solution you'd like

Do not apply a default value to the "title" member of a problem details instance if a the "type" member is non-null.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions