aspnet / Mvc

[Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
5.62k stars 2.14k forks source link

Convert some 'basic' 4XX responses into 'problem' responses #6786

Closed rynowak closed 6 years ago

rynowak commented 7 years ago

pranavkm commented 7 years ago

We're not doing a filter. The plan is to use action result execution extensibility to do this.

rynowak commented 6 years ago

Reactivating this to track the work, which wasn't completed 😆

danroth27 commented 6 years ago

@pranavkm @rynowak What work is still pending here?

rynowak commented 6 years ago

100% of it.

pranavkm commented 6 years ago

Setting up a meeting with @rynowak for Monday to figure out how much work this would be. This should give us an idea on what we want to do with this item for preview1.

tomkerkhove commented 6 years ago

This might be a stupid question, but I presume that:

pranavkm commented 6 years ago

Default flow for exception in controller will also use the new format?

No, it's primarily meant to convert ActionResult with error status codes to errors.

I have the capability to return new format results in exception handler? Yup. The plan would be to have some way to customize what the format looks like. Right now, you could do this for ApiControllers using ApiBehaviorOptions.InvalidModelStateResponseFactory. e.g. https://github.com/aspnet/Mvc/blob/dev/test/WebSites/BasicWebSite/Startup.cs#L37-L47

pranavkm commented 6 years ago

Moving this out to preview2. We need to design this which we did not get around to as part of this release.