I've done it a lot of times (and seen many people do so), but I start to wonder if it is appropriate :
if @record.save
# status 200
else
# failure of validations => status 422
end
Now I see that 422 unprocessable entity
means the request was well-formed, but not semantically correct. As I understood it, a validation error may not be a semantic error.
Note: I'm talking about uniqueness validations, so I'm not sure this qualifies as a user error, as in this question : What's an appropriate HTTP status code to return by a REST API service for a validation failure?
To sum up: should I stop using status 422 ? If so, what should I use instead ?