You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When validation fails, the library used to return a 400 (Bad Request) response. Then this was changed to 409 (Conflict) for some unexplained reason. 9ad8c87#diff-b83d27d3c5374e6d6de83271284db8c4
There doesn't seem to be 100% agreement on what an appropriate REST validation status code should be, but the most commonly used values are 400 or 422. A 409 response only makes sense in a subset of cases (i.e. parameters are structurally valid but there is a business logic conflict).
I believe I can add a custom error handler via configuration options, but it would be nice if I could simply configure the default response code for failed validation, i.e.:
When validation fails, the library used to return a 400 (Bad Request) response. Then this was changed to 409 (Conflict) for some unexplained reason. 9ad8c87#diff-b83d27d3c5374e6d6de83271284db8c4
There doesn't seem to be 100% agreement on what an appropriate REST validation status code should be, but the most commonly used values are 400 or 422. A 409 response only makes sense in a subset of cases (i.e. parameters are structurally valid but there is a business logic conflict).
I believe I can add a custom error handler via configuration options, but it would be nice if I could simply configure the default response code for failed validation, i.e.:
I'd be happy to provide a PR for this (let me know what the "failedValidationResponseCode" configuration property should be called).
The text was updated successfully, but these errors were encountered: