Skip to content
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

Disable ProblemDetailsResultFilter with condition like UseWhen (middleware) to support backwards compatibility #181

Open
eholman opened this issue Aug 15, 2022 · 1 comment

Comments

@eholman
Copy link

eholman commented Aug 15, 2022

Is there a way to disable the functionality in the method OnResultExecuting of ProblemDetailsResultFilter so that the content will not be changed?

We're adding the conventions via AddProblemDetailsConventions but this changes all (existing) behavior. Since we're having existing functionality (an older V1 API) we're looking for a way to bypass the behavior in a dynamic way e.g. when Path (from Context.Request contains "/v1/".

Any thoughts on this one?

@eholman eholman changed the title Disable ProblemDetailsResultFilter with condition like UseWhen (middleware) for backwards compatibility Disable ProblemDetailsResultFilter with condition like UseWhen (middleware) to support backwards compatibility Aug 15, 2022
@tibitoth
Copy link

tibitoth commented Aug 22, 2022

You can bypass the exception handling with this overload: https://github.com/khellang/Middleware/blob/master/src/ProblemDetails/ProblemDetailsOptions.cs#L208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants