Is there a way to create a ErrorAPI class to handle the error response?
Copy code
{
"error": {
"name": [
"The name field is required."
],
"email": [
"The email field is required."
],
"password": [
"The password field is required."
]
}
}
g
gildor
06/30/2018, 2:04 PM
I would say this API is really poorly designed
👍 4
j
James
07/02/2018, 1:33 AM
are you using gson or moshi?
James
07/02/2018, 1:33 AM
because you could write an error adapter
g
gildor
07/02/2018, 1:38 AM
You could of course, on gson and on moshi, it’s more about writing adapter that fits all possible error responses which also could be possible to use on runtime (Sealed class?)