I have a domain model of a graph. When a user tried to modify it a cyclic check is performed and the appropriate http response code is returned.
However, we want to build a proposed change on the client and just check whether or not it's valid to the current state of the graph.
The code is simple enough. Just let the user POST
the graphChangesToValidate
to some validation method and my back-end service which already does this work can confirm whether or not it would be ok to make the changes...
My question is what HTTP status code(s) should I return in this case?
200
would imply that the proposed change passed validation. For failure I don't know if 400
is appropriate because the request is formatted fine and the server is just saying "I understood your request, the answer is no."
I'm thinking that as long as the validation method completes I should return a 200
with either a true
or a false
boolean in the content.
Is there a more standard way to handle this?