hsahu-ksolves123 opened a new pull request, #10219: URL: https://github.com/apache/nifi/pull/10219
**## Summary** This PR fixes the AttributesToJSON processor Resolves NIFI-14855 to handle invalid JSON-like attribute values gracefully instead of failing completely. **## Problem** The processor was throwing JsonProcessingException when encountering attribute values that look like JSON but are malformed, causing the entire flow file to be routed to the failure relationship. **## Solution** - Added proper exception handling in getFormattedAttributes() method - Invalid JSON-like strings are now treated as regular strings instead of causing failures - Valid JSON parsing continues to work as expected **## Changes Made** - **AttributesToJSON.java**: Added try-catch block around JSON parsing with graceful fallback - **TestAttributesToJSON.java**: Updated test to expect SUCCESS for invalid JSON-like attributes **## Testing** - All existing tests pass - Updated testAttributesWithLookALikeJson validates new behavior - Verified backward compatibility maintained -- 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]
