Fix enum validator messages for object, array and text nodes#1095
Fix enum validator messages for object, array and text nodes#1095stevehu merged 1 commit intonetworknt:masterfrom
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1095 +/- ##
============================================
- Coverage 78.90% 78.09% -0.81%
- Complexity 1965 2074 +109
============================================
Files 172 201 +29
Lines 6352 6889 +537
Branches 1255 1265 +10
============================================
+ Hits 5012 5380 +368
- Misses 867 1036 +169
Partials 473 473 ☔ View full report in Codecov by Sentry. |
|
IMHO, this kind of change should not have been made in a patch-level release. |
|
@jochenberger The change is a bug fix and does not break any API. That is why it is a patch release. We can bump up the minor version if there is a reason. Thanks. |
|
As we have added double quotes into the error message, it might break some applications that use the validation message as part of the JSON object. Some escapes are necessary to handle the double quote or back-slash in the validation message. |
Closes #1094
This fixes the enum validator messages as previously object and array nodes were empty strings and the text nodes outputted text without the quotes.
For example given the schema
{ "enum": [6, "foo", [], true, {"foo": 12}] }The message is now
: does not have a value in the enumeration [6, "foo", [], true, {"foo":12}]