https://github.com/rafaelpadovezi/errorresponseformatter
ASPNET's MVC error response formatter
https://github.com/rafaelpadovezi/errorresponseformatter
Last synced: about 2 months ago
JSON representation
ASPNET's MVC error response formatter
- Host: GitHub
- URL: https://github.com/rafaelpadovezi/errorresponseformatter
- Owner: rafaelpadovezi
- Created: 2021-06-19T17:54:49.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-16T13:48:51.000Z (over 3 years ago)
- Last Synced: 2023-03-04T01:15:26.525Z (about 2 years ago)
- Language: C#
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Error Response Formatter
ASPNET's MVC error response formatter
## Usage
```c#
public void ConfigureServices(IServiceCollection services)
{
services
.AddMvc(setup => {
//...mvc setup...
})
.AddErrorResponseFormatter();
}
```It converts the default `modelState` response format to:
```json
{
"error": {
"Name": ["The Name field is required."]
},
"type": "VALIDATION_ERRORS"
}
```## TODO
- [x] Model binding error response
- [x] Model validation error response
- [ ] Non `[ApiController]` controllers
- [ ] Fluent Validation async filter
- [ ] Exception handling end 500 error format
- [ ] Custom BadRequest response format