I have a service where some validation rules must be checked before a particular operation should be able to take place.
For instance, the client should not generate printable reports if all of the validation rules are not being met.
However, an individual client may not have all of the required information (that user may only be able to access a subset of the data that is used to determine validation success), so a request must be sent to the server: basically "is a thing
valid between start
and finish
".
The response will either be some sort of token that indicates VALID: FEEL FREE TO CONTINUE
, or a list of validation failure reasons, that can be presented to the user.
It's obvious that a successful validation will return a 200 OK
. But I don't feel that a success status code is appropriate for a validation failure. I'm leaning towards a 409 Conflict
, but I've only ever used this to reject a PUT
or POST
. Is it valid (snicker) to have a validation failure indicated by a 409
, or is there a better way?
Note: the action performed is not being performed on the server, so skipping this check, and just attempting the action, with a 403
in the case of the action being forbidden is not an option.