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
{{ message }}
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
Currently a HeadersJsonExample class takes the raw output of the TV4 validator and coerces them using a custom coercion function to a header-friendly custom error message format:
However, that coerced message is not being set on the end result object. You can verify that by looking at the headers integration test suite, which asserts the raw tv4 validation error message, instead of the coerced one (and tests pass):
The original intention in the source code implies that the custom coercion should be used for the headers error messages. I'd say we need to treat the original intention as the specification.
The text was updated successfully, but these errors were encountered:
Caution: This change implies an entire Gavel -> Dredd update cycle, because there are structures that contain the "wrong" "At '...'" error format. Changing this error format is considered a breaking change.
I think after migrating to AJV for JSD4 validation I've added a coercion for AJV to mimic the previous error messages. This issue should be fixed in that coercion logic.
Intended behavior
Currently a
HeadersJsonExample
class takes the raw output of the TV4 validator and coerces them using a custom coercion function to a header-friendly custom error message format:gavel.js/lib/utils/tv4-to-headers-message.js
Lines 3 to 23 in 816b7ab
gavel.js/lib/validators/headers-json-example.js
Lines 76 to 81 in 816b7ab
However, that coerced message is not being set on the end result object. You can verify that by looking at the
headers
integration test suite, which asserts the raw tv4 validation error message, instead of the coerced one (and tests pass):gavel.js/test/integration/validate.test.js
Lines 246 to 252 in 816b7ab
Expected behavior
The original intention in the source code implies that the custom coercion should be used for the headers error messages. I'd say we need to treat the original intention as the specification.
The text was updated successfully, but these errors were encountered: