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

    https://github.com/apache/nifi/pull/3060#discussion_r224205938
  
    --- Diff: 
nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-standard-record-utils/src/main/java/org/apache/nifi/schema/validation/StandardSchemaValidator.java
 ---
    @@ -196,21 +196,32 @@ private boolean isTypeCorrect(final Object value, 
final DataType dataType) {
     
                     return true;
                 case MAP:
    -                if (!(value instanceof Map)) {
    -                    return false;
    -                }
    -
    -                final MapDataType mapDataType = (MapDataType) dataType;
    -                final DataType valueDataType = mapDataType.getValueType();
    -                final Map<?, ?> map = (Map<?, ?>) value;
    -
    -                for (final Object mapValue : map.values()) {
    -                    if (!isTypeCorrect(mapValue, valueDataType)) {
    -                        return false;
    +                if (value instanceof Map) {
    +                    final MapDataType mapDataType = (MapDataType) dataType;
    +                    final DataType valueDataType = 
mapDataType.getValueType();
    +                    final Map<?, ?> map = (Map<?, ?>) value;
    +
    +                    for (final Object mapValue : map.values()) {
    +                        if (!isTypeCorrect(mapValue, valueDataType)) {
    +                            return false;
    +                        }
                         }
    +                    return true;
    --- End diff --
    
    Would this be the same if it was a MapRecord?


---

Reply via email to