-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve approach for JSON path and dots in key names #450
Comments
I would like to propose support both by allowing users to escape the dot notation with a backslash. For example setting
and
|
Do we properly handle accessing an item in an array? e.g.
|
Other options proposed by @dlvenable in the original PR are:
|
Not at this moment, but it is a good point and something we should consider when making this decision. |
Do we want to create our own syntax or try to use an existing one such as JsonPointer, JsonPath? We may be very close to Json Pointer already. |
That's a good question and one I have been contemplating. Regarding creating our own, I am leaning less towards this direction at the moment. I would prefer to leverage an existing syntax over creating our own. Creating our own would give us more flexibility and wouldnt couople our implementation to our key structure but its going to introduce other challenges in maintainence, validations, translation to JsonPointer, supporting lists vs objects (as @laneholloway pointed out), etc. Aligning with JsonPointer would be easier on implementation because of the underlying implementation is Jackson. However one could consider this coupling our key syntax to our implementation of an event. I do think we are moving that direction regardless if we are considering JsonPointer or JsonPath. I am leaning towards using JsonPointer as you (@dlvenable) suggested. |
As long as we can index into arrays or lists in a complex document, i'm good with either. I'm more familiar with JsonPath, but I won't let my bias push one over the other. |
I'm fine with either Json Pointer or Json Path. My understanding is that Json Path is more robust, but that robustness is primarily useful on the query side. And Json Pointer we have out-of-the-box support for with Jackson. I will note that Json path can support dots in the path by way of |
Then I think we should move forward with JsonPath. |
I mistyped a sentence above in my comment yesterday. Jackson has support for JsonPointer. It does not have support for JsonPath. I corrected my original comment which said it supports JsonPath. |
We could conceivably support both JsonPointer and JsonPath since they start differently. JsonPointer starts with a slash and JsonPath often starts with a dollar sign. However, in either case, I'd like to support setting keys without a leading slash or dollar sign. What would we consider this to be? Just a raw key name with no path? |
I think we can provide some semantics around that and say that a dotted notation key name (e.g. |
Supporting both at some point sounds nice, I know we will have to consider the scenario where a user's JsonPointer key contains a dot and they want to use JsonPath at some point. There may be other edge cases too. That being said I would like us to pick one path forward for now. We can add support for the other if users request it like @dlvenable suggested. I am onboard with moving forward with JsonPointer. |
I'm also onboard with moving forward with JsonPointer for now. Due to the possibility of supporting both, I think this is a two-way door. |
Consensus reached, JsonPointer for initial implementation. |
…nsearch-project#450 Signed-off-by: Christopher Manning <[email protected]>
…nsearch-project#450 Signed-off-by: Christopher Manning <[email protected]>
…nsearch-project#450 Signed-off-by: Christopher Manning <[email protected]>
Signed-off-by: Christopher Manning <[email protected]>
…nsearch-project#450 Signed-off-by: Christopher Manning <[email protected]>
…nsearch-project#450 Signed-off-by: Christopher Manning <[email protected]>
…nsearch-project#450 Signed-off-by: Christopher Manning <[email protected]>
Is your feature request related to a problem? Please describe.
How do we want to support both of these requirements:
my.field
.Raised by this question:
https://github.com/opensearch-project/data-prepper/pull/435/files#r732111116
The text was updated successfully, but these errors were encountered: