exceptionfactory commented on code in PR #11208:
URL: https://github.com/apache/nifi/pull/11208#discussion_r3253921690
##########
nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/json/JsonPathReader.java:
##########
@@ -152,6 +154,23 @@ protected Collection<ValidationResult>
customValidate(final ValidationContext va
.build());
}
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ super.migrateProperties(config);
+
+ if
(config.isPropertySet(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS)) {
+ final String allowCommentsRawValue =
config.getRawPropertyValue(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS).orElse("");
Review Comment:
It looks like this should fall back to `"false"` to reflect the default
behavior.
```suggestion
final String allowCommentsRawValue =
config.getRawPropertyValue(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS).orElse(Boolean.FALSE.toString());
```
##########
nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/yaml/YamlTreeReader.java:
##########
@@ -44,26 +46,28 @@
+ "See the Usage of the Controller Service for more information and
examples.")
public class YamlTreeReader extends JsonTreeReader {
- private static final boolean ALLOW_COMMENTS_DISABLED = false;
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ super.migrateProperties(config);
+
config.removeProperty(AbstractJsonRowRecordReader.PARSING_STRATEGY.getName());
Review Comment:
Is this necessary? It is not part of the existing version, so it should not
need to be removed in the migrate method.
##########
nifi-extension-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/json/JsonTreeReader.java:
##########
@@ -142,10 +142,24 @@ public void migrateProperties(PropertyConfiguration
config) {
config.renameProperty("starting-field-name",
STARTING_FIELD_NAME.getName());
config.renameProperty("schema-application-strategy",
SCHEMA_APPLICATION_STRATEGY.getName());
config.renameProperty(OBSOLETE_SCHEMA_CACHE, SCHEMA_CACHE.getName());
+
+ if
(config.isPropertySet(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS)) {
+ final String allowCommentsRawValue =
config.getRawPropertyValue(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS).orElse("");
Review Comment:
```suggestion
final String allowCommentsRawValue =
config.getRawPropertyValue(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS).orElse(Boolean.FALSE.toString());
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]