NIFI-12456 Enabled JsonTreeReader and JsonPathReader to parse JSON leniently.#11208
NIFI-12456 Enabled JsonTreeReader and JsonPathReader to parse JSON leniently.#11208dan-s1 wants to merge 4 commits into
Conversation
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for working on this configuration option @dan-s1. The general approach looks clear, I provided some recommendations on naming.
|
@exceptionfactory I have made all the changes you requested. I am concerned though that the configuration for the Is the only way possible to remove I am assuming I cannot simply remove them in So I added that code. Please let me know if that is okay. |
|
@exceptionfactory I believe I addressed all the issues you had brought up. Is there anything else you would like me to change for this PR? |
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for making the updates and also adjusting the YAML Reader. The general approach looks good. I noted a few remaining minor things, and then this should be ready to go.
| super.migrateProperties(config); | ||
|
|
||
| if (config.isPropertySet(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS)) { | ||
| final String allowCommentsRawValue = config.getRawPropertyValue(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS).orElse(""); |
There was a problem hiding this comment.
It looks like this should fall back to "false" to reflect the default behavior.
| final String allowCommentsRawValue = config.getRawPropertyValue(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS).orElse(""); | |
| final String allowCommentsRawValue = config.getRawPropertyValue(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS).orElse(Boolean.FALSE.toString()); |
| 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(""); |
There was a problem hiding this comment.
| final String allowCommentsRawValue = config.getRawPropertyValue(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS).orElse(""); | |
| final String allowCommentsRawValue = config.getRawPropertyValue(AbstractJsonRowRecordReader.OBSOLETE_ALLOW_COMMENTS).orElse(Boolean.FALSE.toString()); |
| @Override | ||
| public void migrateProperties(PropertyConfiguration config) { | ||
| super.migrateProperties(config); | ||
| config.removeProperty(AbstractJsonRowRecordReader.PARSING_STRATEGY.getName()); |
There was a problem hiding this comment.
Is this necessary? It is not part of the existing version, so it should not need to be removed in the migrate method.
Summary
NIFI-12456
The changes in this PR now allow for
JsonTreeReaderandJsonPathReaderto parse incoming JSON leniently which includes allowingTracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation