Skip to content

Consumes Attribute 415 return format #25107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Deasel011 opened this issue Feb 22, 2022 · 6 comments · Fixed by #27009
Closed

Consumes Attribute 415 return format #25107

Deasel011 opened this issue Feb 22, 2022 · 6 comments · Fixed by #27009
Assignees
Labels
doc-enhancement Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

@Deasel011
Copy link

Deasel011 commented Feb 22, 2022

Hi there, is there a reason why the Consumes does not return a 415 formatted by a ProblemDetails?
The rest of the page implies that if you do not want a ProblemDetail, you have to Suppress it. Why is the 415 returned by the Consumes Attribute not also returning a ProblemDetails unless explicitly suppressed when the Content-Type is malformed?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@serpent5
Copy link
Contributor

I think this might be a bug in the product. There are two filters at play here:

  1. The ConsumesAttribute resource filter.
  2. The ClientErrorResultFilter always-run result filter.

The ConsumesAttribute short-circuits the filter pipeline. When that happens, the ClientErrorResultFilter, which is responsible for making the ProblemDetails response, doesn't run.

@Rick-Anderson How should we handle this?

@Rick-Anderson
Copy link
Contributor

@pranavkm @brunolins16 please review

@brunolins16
Copy link
Member

@Rick-Anderson probably this is one of the scenarios we will need to review as part of dotnet/aspnetcore#32957.

It is assigned to me right now and we are planning to work on it later in .NET 7.

@brunolins16
Copy link
Member

@Rick-Anderson this was fixed with the new ProblemDetailsService. Are you planning to add docs that covers it here #26685?

@Rick-Anderson
Copy link
Contributor

Rick-Anderson commented Sep 23, 2022

What would we add? We fixed a bug? Now that it's fixed it's not an issue.

@brunolins16
Copy link
Member

Actually, there is nothing in the docs that saying PD will not be generated for 415, so, maybe we don't need to add anything here other than what you have done already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-enhancement Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants