yakshup commented on PR #9682:
URL: https://github.com/apache/nifi/pull/9682#issuecomment-2629217087

   @exceptionfactory Thank you for the review and feedback.
   
   ### Clarification on the Motivation for the New Property
   The primary reason for introducing a separate property for the filename is 
to resolve an existing issue with how `JOLT_SPEC ` handles Expression Language 
(EL).
   
   Currently, the `JOLT_SPEC` property serves two distinct purposes:
   
   - Accepting inline JOLT specifications as JSON.
   - Accepting a file path (which may also contain EL).
   
   The problem arises when the property value contains Expression Language 
referring to a file path. 
   The current logic evaluates EL first and always assumes the result is a JSON 
specification, even if the value was intended to be a file path. This creates 
an edge case where valid file paths containing EL become invalid, as they are 
incorrectly parsed as JSON.
   
   By introducing a dedicated property for the filename, we can:
   
   - Clearly distinguish between inline JSON specs and file-based specs.
   - Ensure correct handling of EL, whether used for JSON content or file paths.
   - Improve maintainability by eliminating ambiguity in `JOLT_SPEC`.
   
   **Use of the Resource Abstraction**
   
   The existing implementation already utilizes the `readTransform` method from 
the Jolt abstraction layer, which ensures proper handling of file paths and 
JSON parsing. Additionally, necessary validations are already in place to 
verify that the file path is valid before processing.
   
   Could you clarify if the concern is specifically about file access within 
`readTransform`, or if it is a general recommendation to adopt NiFi's Resource 
abstraction for consistency? If required, I can explore integrating 
`ResourceReference` to enhance how NiFi handles file-based properties.


-- 
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]

Reply via email to