I have a configuration that has a complex object:
- This complex object is conditioned with an @ActiveIf
- It contains some nested properties
- Some of nested properties have constraints like @Required or @Pattern
- Nested properties constraint are checked even if the main object has its ActiveIf not met (false)
Here is a simplified example:
class MyDatastore{ @Option private String aString; @Option private boolean condConf; @Option @ActiveIf(target = "condConf", value = "true") private ComplexConf myComplexConf = new ComplexConf(); ; public static class ComplexConf { @Option @Required @Pattern("^https?://.+$") private String url = ""; } }
If configure my connector with "condConf= false", so, "myComplexConf" should not be set and "myComplexConf.url" could be let to "", its constraint @Required & @Pattern should be checked, but it is.
After debugging, it seems the issue comes from there :
Indeed, onObject() is called on 'myComplexConf', but in this method, we don't check if this object if visible or not (ActiveIf), and nested attributes are computed first by the call to unflatten() method.
|
|
|
|
|
---|---|---|---|---|
00283827 | 2 |
- duplicates
-
TCOMP-1960 JsonSchema validation regression with the RequiredValidation ext impl
- Done
- is related to
-
TCOMP-1688 Rewrite JsonSchema required rules to reflect component's validation rules
- Done
-
TCOMP-1788 Invalid properties validation
- Done
-
TCOMP-2379 Validations on parent attributes are check even if the object is ActiveIf==false when value is null
- Rejected