-
Notifications
You must be signed in to change notification settings - Fork 4
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
Uable to access nested json field #4
Comments
Hello @grzegorz-taramina , Sorry for the late reply (I was afk for the last two weeks). Current version do not accept accessing in nested data object. This can be added. Is one of these alternatives what you're looking for:
If not what you're looking for, we can see how to add the nested data structure field accessing |
Hey @celadari, `override protected[this] def deserializeValueLogic(jsonLogic: JsObject, jsonLogicData: JsObject): ValueLogic[_] = {
}` Maybe it's worth adding that to the library as usual scenario for using jsonlogic is passing complex objects to jsonlogic engine. Cheers |
Clever move, I will check if adding this line doesn't break unit and functional tests. I'll let you know :) |
Hey @celadari, |
Hi,
I'm trying to use json logic scala for very common case which is accessing field in nested data object.
I have the following data structure:
{ "booking" : { "ref" : 123 }, "test" : 666 }
And the following rule:
{ "<" : [ { "var" : "booking.ref", "type" : { "codename" : "int" } }, { "var" : "test", "type" : { "codename" : "int" } } ] }
Deserialization fails becasue I don't have "booking.ref" field in my data strucutre but I do have booking \ ref.
Does that mean json-logic-scala can only handle root level data fields?
When I change "booking": { "ref":"..." } to "booking.ref" : 444 it works but it's really not what I need.
The text was updated successfully, but these errors were encountered: