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
I am trying to use coll.JSONPath to evaluate a particular key path structure but if for whatever reason the path does not exist, the template generation errors with error:
ERR error="renderTemplate: failed to render template <arg>: template: <arg>:1:93: executing \"<arg>\" at <coll.JSONPath>: error calling JSONPath: executing JSONPath failed: baz is not found"
You can test this by running the following gomplate command:
It would be great if JSONPath could support returning empty values when the path is not found, perhaps based on the missingKey setting. Some support in favor of adding this capability to coll.JSONPath can be seen in this comparison doc of the various different supporting libraries for JSONPath that have support for "empty" return values.
Hi,
I am trying to use
coll.JSONPath
to evaluate a particular key path structure but if for whatever reason the path does not exist, the template generation errors with error:You can test this by running the following gomplate command:
It would be great if JSONPath could support returning empty values when the path is not found, perhaps based on the
missingKey
setting. Some support in favor of adding this capability tocoll.JSONPath
can be seen in this comparison doc of the various different supporting libraries for JSONPath that have support for "empty" return values.It could be as simple as changing this line of code to honor the
missingKey
value https://github.com/hairyhenderson/gomplate/blob/main/coll/jsonpath.go#L53===
Gomplate Version: v4.0.0-pre-2
The text was updated successfully, but these errors were encountered: