response → validation → decoding
You should only decode valid data
If you skip validation:
server returns 404 / 500
↓
you try to decode
↓
crash / decoding error
Server returns:
{ "error": "User not found" }
But you expect:
{ "name": "Zeeshan", "email": "..." }
Decoding fails
check statusCode (200–299)
↓
only then decode
validation = "is this response usable?"
decoding = "convert usable data into model"