Skip to content

Commit

Permalink
Merge pull request #12088 from dulithsenanayake/fix-api-update-issue
Browse files Browse the repository at this point in the history
Add additional check for display true scenarios of mandatory properties
  • Loading branch information
dulithsenanayake committed Aug 18, 2023
2 parents c7be424 + eda82a0 commit 6ee59bb
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2004,12 +2004,22 @@ public static boolean validateMandatoryProperties(org.json.simple.JSONArray cust
boolean isRequired = (boolean) property.get(APIConstants.CustomPropertyAttributes.REQUIRED);

if (isRequired) {
APIInfoAdditionalPropertiesMapDTO mapPropertyDisplay =
additionalPropertiesMap.get(propertyName + "__display");
APIInfoAdditionalPropertiesMapDTO mapProperty = additionalPropertiesMap.get(propertyName);
if (mapProperty == null) {
if (mapProperty == null && mapPropertyDisplay == null) {
return false;
}
String propertyValue = mapProperty.getValue();
if (propertyValue == null || propertyValue.isEmpty()) {
String propertyValue = "";
String propertyValueDisplay = "";
if (mapProperty != null) {
propertyValue = mapProperty.getValue();
}
if (mapPropertyDisplay != null) {
propertyValueDisplay = mapPropertyDisplay.getValue();
}
if ((propertyValue == null || propertyValue.isEmpty()) &&
(propertyValueDisplay == null || propertyValueDisplay.isEmpty())) {
return false;
}
}
Expand Down

0 comments on commit 6ee59bb

Please sign in to comment.