Skip to content

AddApiVersioning with a custom IProblemDetailsWriter breaks both the custom and decorated IProblemDetailsWriter #1135

Open
@EmperorArthur

Description

@EmperorArthur

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Cross posting from dotnet/aspnetcore#62186

Reported there, since the code explicitly mentions dotnet/aspnetcore#52577.

tldr: TryAddProblemDetailsRfc7231Compliance searches for "DefaultProblemDetailsWriter" but always replaces the first "IProblemDetailsWriter" registered with the service provider.

Expected Behavior

I can use a custom IProblemDetailsWriter before the default writer.

Steps To Reproduce

See dotnet/aspnetcore#62186

Exceptions (if any)

None

.NET Version

9.0.203

Anything else?

See dotnet/aspnetcore#62186

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions