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

Ability to replace validated value in error message #106

Open
fan-tom opened this issue May 23, 2024 · 0 comments
Open

Ability to replace validated value in error message #106

fan-tom opened this issue May 23, 2024 · 0 comments

Comments

@fan-tom
Copy link

fan-tom commented May 23, 2024

When we are validating json agains json schema, it may contain user input (e.g.) text, that we want to avoid exposing in validation exception message. Currently we have an ability to customize the error message text using com.github.fge.jsonschema.cfg.ValidationConfiguration#validationMessages, where we can exclude the actual value that failed validation.
But it has to be done for each message template separately.
Instead it would be useful to postpone message rendering, which happens in com.github.fge.jsonschema.core.report.ProcessingMessage#addArgument until it is explicitly requested, which would allow us to replace the value value in message map with masked value (e.g. replace all non-space string character with *) in application code.

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

No branches or pull requests

1 participant