Skip to content
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

Empty collection with model indexing when using a custom JSON formatter #380

Open
cocetov opened this issue May 16, 2023 · 2 comments
Open

Comments

@cocetov
Copy link

cocetov commented May 16, 2023

Hello!

I have encountered a problem when using the RedisOM. My problem is that I can't index models using the index I created through RedisConnectionProvider.

It started when I implemented my custom JSON formatter, which changes serialization names of the class properties to snake_case. Whenever I use Linq methods to access the data, they always return an empty collection.

Here's how I do that:

RedisSerializationSettings.JsonSerializerOptions.PropertyNamingPolicy = new JsonSnakeCaseLowerNamingPolicy();

I found an issue #347 on the same topic where a solution to a similar problem was proposed. However, I believe this issue needs a more appropriate approach, possibly through JsonSerializerSettings.

I would be grateful for any help or guidance on this issue. Thank you!

@slorello89
Copy link
Member

This is probably because the schema parser isn't factoring in these serialization settings when it's figuring out how to build the paths to the nodes in your object.

@cocetov
Copy link
Author

cocetov commented May 17, 2023

Is it possible to adapt the parser so that it takes into account serialization settings, or should I use the attributes to make queries work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants