You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Http sink: Empty String if the value does not exist in json body Template (#89)
* fix: add jsonpath Option while parsing template
* fix: * imports are failing the builds
* fix: code cleanup and test cases
* fix: code cleanup
* add: test cases to comprehensively test the new functionality
* fix: code cleaning
* add: documentation
* update: firehose version
---------
Co-authored-by: Mayank Rai <mayank.rai@gojek.com>
Co-authored-by: deepanshgoyal <deepansh.goyal@gojek.com>
Defines the parsing options for the JSON body template. This configuration controls how JsonPath expressions behave when parsing the protobuf message to extract values for the template.
167
+
**Available Options:**
168
+
169
+
-**`DEFAULT_PATH_LEAF_TO_NULL`**: Returns `null` for missing leaf properties instead of throwing exceptions. Only affects missing final properties in a path (e.g., `$.user.name` on `{"user": {}}` returns `null`). Recommended for graceful handling of optional fields.
170
+
171
+
-**`ALWAYS_RETURN_LIST`**: Forces all JsonPath queries to return results as a List, even for single values. For example, `$.name` returns `["John"]` instead of `"John"`. Useful when you need consistent List return types.
172
+
173
+
-**`AS_PATH_LIST`**: Returns the JsonPath expressions pointing to matching nodes instead of their actual values. For example, returns `["$['users'][0]['name']"]` instead of `"John"`. Useful when you need to know data location rather than the data itself.
174
+
175
+
-**`SUPPRESS_EXCEPTIONS`**: Suppresses ALL exceptions during JsonPath evaluation and returns `null` or empty collections for any errors (syntax errors, missing paths, type errors). Provides complete fault tolerance but less specific error handling.
176
+
177
+
-**`REQUIRE_PROPERTIES`**: Throws exceptions if any property referenced in the path doesn't exist. Opposite of `DEFAULT_PATH_LEAF_TO_NULL` - enforces strict validation that all path components exist.
178
+
179
+
**Key Differences:**
180
+
-`SUPPRESS_EXCEPTIONS` vs `DEFAULT_PATH_LEAF_TO_NULL`: The former suppresses all types of exceptions broadly, while the latter only handles missing leaf properties specifically, allowing other exceptions (like syntax errors) to still be thrown for better debugging.
0 commit comments