Skip to content

Commit

Permalink
JNG-6078 PayloadValidator throws an error for relations with the defa…
Browse files Browse the repository at this point in the history
…ult element (#228)

* exclude special field from payload validation
  • Loading branch information
gaborflorian authored Jan 8, 2025
1 parent 98013fb commit c8a3626
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,16 @@ private void processPayload(Payload instance, PayloadTraverser.PayloadTraverserC

final boolean ignoreInvalidValues = (Boolean) validationContext.getOrDefault(IGNORE_INVALID_VALUES_KEY, IGNORE_INVALID_VALUES_DEFAULT);
if (!validatorProvider.getValidators().isEmpty()) {
ctx.getType().getEAllAttributes().forEach(attribute -> processAttribute(instance, attribute, validationResults, validationResultContext, ignoreInvalidValues));
ctx.getType().getEAllReferences().forEach(reference -> processReference(instance, reference, validationResults, currentContext, ignoreInvalidValues));
for (EAttribute attribute : ctx.getType().getEAllAttributes()) {
if (!attribute.getName().startsWith("_")) {
processAttribute(instance, attribute, validationResults, validationResultContext, ignoreInvalidValues);
}
}
for (EReference reference : ctx.getType().getEAllReferences()) {
if (!reference.getName().startsWith("_")) {
processReference(instance, reference, validationResults, currentContext, ignoreInvalidValues);
}
}
}
}

Expand Down

0 comments on commit c8a3626

Please sign in to comment.