Skip to content

Commit

Permalink
#237 EA-1915 added mandatory type validation for Agent.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgraf committed Feb 20, 2020
1 parent 0259d1f commit 5df87c5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,11 @@ private void validateAgentEntityBody(Body body) throws ParamValidationException,
throw new PropertyValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD,
I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "agent.body.prefLabel" });

// check mandatory field type
if (body.getType() == null || StringUtils.isBlank(body.getType().get(0)))
throw new PropertyValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD,
I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "agent.body.type" });

// check mandatory field - one of the professionOrOccupation, begin, dateOfBirth, end, dateOfDeath
// placeOfBirth, placeOfDeath
// if (agent.getPlaceOfBirth() == null && agent.getPlaceOfDeath() == null
Expand Down

0 comments on commit 5df87c5

Please sign in to comment.