Maps the Maple.Result to the HTTP response (ASP.NET Core version)
Check also my libraries:
- Maple.Result,
- Maple.Result.Extensions.Functions.Worker (coming soon),
- Maple.Result.Extensions.HttpClient.
Do you like it? Show your support by giving this project a star!
➡️ Basic mapping without configuration.
🔲 Integration tests.
🔲 Configuration passed as a parameter to the extension method.
🔲 Support for global configuration.
🔲 Support for multiple successful codes.
🔲 Support for Created (201) with Location header.
🔲 Documentation.
Example
{
"type": "https://example.com/probs/out-of-credit",
"status": 400,
"title": "You do not have enough credit.",
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/accounts/12345/msgs/abc",
"errors": [
{
"pointer": "#/age",
"detail": "must be a positive integer",
"detailTemplated": {
"messageId":"user.details.age.mustBePositive"
}
},
{
"pointer": "#/profile/colour",
"detail": "must be ‘green’, ‘red’ or ‘blue’",
"detailTemplated": {
"messageId": "user.profile.colour",
"params": {
"validValueIds": [
"user.profile.colour.green",
"user.profile.colour.red",
"user.profile.colour.blue"
]
}
}
}
],
"detailTemplated": {
"messageId": "user.account.balance.tooLow",
"params": {
"errorCode": "UAB17",
"accounts": [
{
"title": "Main (***9456)",
"url": "/accounts/12345"
},
{
"title": "Main (***3357)",
"url": "/accounts/67890"
}
],
"currentBalance": 30,
"requiredBalance": 50
}
}
}- Problem Details for HTTP APIs - RFC 7807 is dead, long live RFC 9457
- tag URI scheme
- RFC 1738: Uniform Resource Locators (URL)
- RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
- RFC 4151: The 'tag' URI Scheme
- RFC 6901: JavaScript Object Notation (JSON) Pointer
- RFC 9457: Problem Details for HTTP APIs
Please contact author: engineer(at sign)blumail(dot)me