Github user JPercivall commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi/pull/45#discussion_r84527495
  
    --- Diff: 
minifi-commons/minifi-commons-schema/src/main/java/org/apache/nifi/minifi/commons/schema/ConnectionSchema.java
 ---
    @@ -60,30 +53,11 @@ public ConnectionSchema(Map map) {
             super(map, CONNECTIONS_KEY);
     
             sourceId = getOptionalKeyAsType(map, SOURCE_ID_KEY, String.class, 
CONNECTIONS_KEY, "");
    -        if (StringUtil.isNullOrEmpty(sourceId)) {
    -            sourceName = getRequiredKeyAsType(map, SOURCE_NAME_KEY, 
String.class, CONNECTIONS_KEY);
    -        }
    -
    -        String sourceRelationshipName = getOptionalKeyAsType(map, 
SOURCE_RELATIONSHIP_NAME_KEY, String.class, CONNECTIONS_KEY, null);
    -        if (StringUtil.isNullOrEmpty(sourceRelationshipName)) {
    -            sourceRelationshipNames = getOptionalKeyAsType(map, 
SOURCE_RELATIONSHIP_NAMES_KEY, List.class, CONNECTIONS_KEY, new ArrayList());
    -            if (sourceRelationshipNames.isEmpty()) {
    -                
addValidationIssue(getIssueText(SOURCE_RELATIONSHIP_NAMES_KEY, CONNECTIONS_KEY, 
"expected at least one relationship to be specified"));
    -            }
    -        } else {
    -            if (map.containsKey(SOURCE_RELATIONSHIP_NAMES_KEY)) {
    -                addValidationIssue("Only one of " + 
SOURCE_RELATIONSHIP_NAME_KEY + ", " + SOURCE_RELATIONSHIP_NAMES_KEY + " should 
be set per connection.  Found both on "
    -                        + (StringUtil.isNullOrEmpty(getName()) ? getId() : 
getName()));
    -                sourceRelationshipNames = getRequiredKeyAsType(map, 
SOURCE_RELATIONSHIP_NAMES_KEY, List.class, CONNECTIONS_KEY);
    -            } else {
    -                sourceRelationshipNames = new 
ArrayList<>(Arrays.asList(sourceRelationshipName));
    -            }
    +        sourceRelationshipNames = getOptionalKeyAsType(map, 
SOURCE_RELATIONSHIP_NAMES_KEY, List.class, CONNECTIONS_KEY, new ArrayList<>());
    +        if (sourceRelationshipNames.isEmpty()) {
    +            addValidationIssue("Expected at least one value in " + 
SOURCE_RELATIONSHIP_NAMES_KEY + " for " + CONNECTIONS_KEY + " " + getName());
             }
    -
             destinationId = getOptionalKeyAsType(map, DESTINATION_ID_KEY, 
String.class, CONNECTIONS_KEY, "");
    --- End diff --
    
    Same comment as on source, I think this should be "required".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to