PISTON-1082: Crossbar validation errors with the same top level key will no longer overwrite each other but instead will now merge the keys where possible #6699
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Kazoo 5pr: https://github.com/2600hz/kazoo-crossbar/pull/140
When CB builds the error response from multiple validation errors it would do a top level merge only resulting in errors regularly overwriting each other in the response.
EG:
Take the error list below
With the current merge CB would return:
With this solution, CB will respond with:
This still does not handle the the case where the keys exactly match but the only way to do this would be to change the response type of the error to an array (Breaking change) but maybe its worth considering for a future version.