Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customization of const message to include input value #1057

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

justin-tay
Copy link
Contributor

Closes #846

This makes it possible for a custom locale properties file to generate the desired message for the const validator.

This doesn't make it the default as doing so will make it inconsistent with the rest of the messages for other validators.

The input node value that caused the failure can be consistently retrieved using message.getInstanceNode() and its path from message.getInstanceLocation() and a custom OutputFormat implementation can be used to consistently format the messages.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.74%. Comparing base (48ca3c2) to head (8b0b859).
Report is 21 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1057      +/-   ##
============================================
- Coverage     78.90%   78.74%   -0.16%     
- Complexity     1965     2033      +68     
============================================
  Files           172      191      +19     
  Lines          6352     6596     +244     
  Branches       1255     1260       +5     
============================================
+ Hits           5012     5194     +182     
- Misses          867      927      +60     
- Partials        473      475       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stevehu stevehu merged commit b063972 into networknt:master Jun 11, 2024
4 checks passed
@justin-tay justin-tay deleted the constmsg branch June 12, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show value of const data in validation message if its a string
3 participants