Skip to content

Ability to replace validated value in error message #106

Open
@fan-tom

Description

@fan-tom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions