-
Notifications
You must be signed in to change notification settings - Fork 94
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
Returning mapped nested or empty property results in NullPointerException #264
Labels
bug
Something isn't working
Comments
bastiaan-dev
changed the title
Returning mapped nested property results in NullPointerException
Returning mapped nested or empty property results in NullPointerException
Jun 12, 2023
Two (failing) test cases, simulating the issues:
|
Thanks @bastiaan-dev ! |
bsbodden
added a commit
to bsbodden/redis-om-spring
that referenced
this issue
Jun 19, 2023
bsbodden
added a commit
to bsbodden/redis-om-spring
that referenced
this issue
Jun 19, 2023
bsbodden
added a commit
that referenced
this issue
Jun 19, 2023
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
redis-om-spring.version: 0.8.3
The same NullPointer happens in 2 scenario's:
Having a nested object:
Having a product with property on root and a nested property:
When building a searchstream and mapping only 2 fields:
This results in a NullPointer exception while parsing the result:
SCENARIO 1:
This happens in scenario 1, when one of the products has a null value in Redis for one of the requested properties. In this case when one of the product.colorCode is NULL, the Nullpointer is is thrown while parsing to result tuples.
SCENARIO 2:
This happens in scenario 2 when the result from Redis does not contain the expected Product$.NESTED_OBJECT_NESTED_PROPERTY, field, instead only the root property is returned.
Outgoing query:
Partial Response:
When I manualy fire a query but change the underscore '$.nestedObject_nestedProperty' to a dot '$.nestedObject.nestedProperty', the query does have expected result and null pointer disappears:
Partial Response:
Additional note: when using the nested field within a search query, the field DOES work with an underscore in the query:
So it seems the query should have underscore for the nested field when used as query param, but should not have the underscore when used as return value (which seems inconsistent from Redis). Scanning the code, in both cases the searchAlias of the searchField is used (containing underscore)
The text was updated successfully, but these errors were encountered: