You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
As backend I'm using an ASP.net Core server, and the default server validation messages it returns are arrays of string, not strings.
Currently, to make react admin handle them I need some code in the dataprovider to join it into strings. But it would be great if react admin could handle this out of the box. As it is the default behavior for all ASP.net backends, I imagine I'm not alone in having this issue.
This is the job of your dataProvider. We don't want to include code specific to a backend implementation. You could wrap the default httpClient to handle this instead of repeating the error handling in all your dataProvider methods.
Is your feature request related to a problem? Please describe.
As backend I'm using an ASP.net Core server, and the default server validation messages it returns are arrays of string, not strings.
Currently, to make react admin handle them I need some code in the dataprovider to join it into strings. But it would be great if react admin could handle this out of the box. As it is the default behavior for all ASP.net backends, I imagine I'm not alone in having this issue.
Here's an example of the validation error JSON:
Describe the solution you'd like
Just doing a
.join(', ')
if the error is an array would be fine by me.Describe alternatives you've considered
Currently I have code to catch the HttpError and modify it:
Additional context
Their error response is based on https://datatracker.ietf.org/doc/html/rfc7807 according to their docs at https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.problemdetails?view=aspnetcore-9.0
The text was updated successfully, but these errors were encountered: