frankframework / frankframework/frankframework

Refactor validator structure

Open
#10,617 0 comments 0 reactions 0 assignees View on GitHub
Refactor Technical Debt Validation
Dominant language
Java
Stars
167
Forks
87
Avg merge
1d 2h
Merged PRs (30d)
206

Description

The way validators work in the framework are heavily influenced by how they were used with an XSD. The current structure uses an obscure hierarchy starting with `IDualModeValidator` -> `AbstractValidator`. If a validator somehow `isConfiguredForMixedValidation` it will wrap the current validator in an internal `ResponseValidatorWrapper` class, which will use response validation settings if the 'responseMode' is true.
But, in most cases, ResponseMode is always false, but is somehow set to true by the wrapper. Anyway, it's so over engineered that it's really hard to understand.

Anyway, this was made painfully obvious when I wasn't able to use a dual mode validator _only_ for output validation. Which really should be possible.

We probably need to go one of two ways:
* don't rely on one validator to be able to validate input and output. This might result in having both an inputValidator and an outputValidator for your pipeline. Or more extensive structure where one Validator might have two implementations - one for input and one for output?
* Find out how to make a more generic way on how to determine if we're validing input or output

In both cases, we most likely need to refactor the callers of the validators as well, that is now too generic and tricks are used to make a validator validate the output.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.