katien
12/21/2017, 12:36 AM{
"errors": {
"first_name": [
"first name is required"
],
"last_name": [
"last name is required"
],
"image": [
"Invalid image format"
]
},
"message": "Invalid profile data",
"status": 400
}
I parse my json into this response model:
data class ErrorResponse (
var errors: Map<String, List<String>> = emptyMap(),
var status: Int = 0) {
operator fun get(k: String): List<String>? = errors[k]
}
silentsudo
12/21/2017, 1:40 PM