-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
4.0.0.Beta2
-
None
The ParameterCorrector of an AttributeDefinition must attempt to correct the value before the value is validated against the AttributeDefinition's ParameterValidator.
This works fine when DMR operations are executed against the server.
However, this fails when XML is parsed as the XML parser is validating the value without correcting it first.
I encounter this issue in WFLY-9706 when the validator constrains to use only -1 instead of any negative value.
If I had a ParameterCorrect that correct any negative values (e.g. -3) to -1, the XML parser fails because the value (-3) is not valid (must be -1).
Using :write-attribute works fine as the ParameterCorrect will correct -3 to -1 before it is validated.
The simple short term fix is to call the ParameterCorrect when the XML parser read the attribute before it validates its value.
However this duplicates code that is already done in AttributeDefinition.validateAndSet.
We could handle all this logic (correction/validation) only when the DMR operations are executed.
However doing so would make it impossible to report informative XML errors as the user would have to find how the faulty DMR op map to the XML file he provided.
So keeping this logic of correction/validation when XML is parsed is useful for error reporting but it should delegate to some methods of AttributeDefinition instead of duplicating the code (and missing some cases such as parameter correction)
- blocks
-
WFLY-9706 Newly added InfiniteOrPositiveValidators to messaging attributes should just print warning if negative values are not -1
- Closed