-
Notifications
You must be signed in to change notification settings - Fork 81
JsonException when deserializing projection from FT.SEARCH of JSON value #518
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
Comments
Not a case I've ever run into before, probably do need something in the object handler to handle this particular case. What you have posted above looks roughly correct. |
mfaulcon
pushed a commit
to mfaulcon/redis-om-dotnet
that referenced
this issue
Feb 7, 2025
…sented as a number (redis#518)
this is a redis feature if you specify specific fields when receiving data. the same happens with DateTime. |
slorello89
pushed a commit
that referenced
this issue
Apr 9, 2025
#519) Address boolean deserialization from JSON when the value may be represented as a number (#518) Co-authored-by: Mark Faulcon <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While testing performance of a local project using RedisOM and GraphQL, I encountered a difference in the behavior of Redis that leads to a System.Text.Json.JsonException during deserialization. Specifically, when enumerating the RedisCollection without projection, I encountered no issues; an example of the Redis query and response is below:
Running a similar query with a projection from GraphQL against the same Redis Db produced a different result, however, as well as the exception:
Of particular not is that in this case, IsApproved was returned as a number instead of as a string. During deserialization, this resulted in the JsonException, with the inner exception "InvalidOperationException: Cannot get the value of a token type 'Number' as a boolean".
Is this a known issue? I've created a fork of RedisOM and added some code to
redis-om-dotnet/src/Redis.OM/RedisObjectHandler.cs
Line 500 in 7f43b7b
The text was updated successfully, but these errors were encountered: