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

Query/Json: inconsistent behavior around missing required navigations in JSON entities #35751

Open
maumar opened this issue Mar 8, 2025 · 0 comments

Comments

@maumar
Copy link
Contributor

maumar commented Mar 8, 2025

When we have a JSON entity which owns another via required navigation, we have inconsistent behavior, when that navigation is missing in the actual JSON.

If we project the owner entity, missing required navigation is materialized as null with no errors. This is because of how we process the JSON on relational - we parse the stream, so we only fill properties/navigations that we encounter data for. If there is no data for required navigation, its materialization code is not triggered and we end up with the default value (null).

However, if the required navigation is projected directly (rather than as part of an owner), we do run some validation when attempting to materialize it and throw:

System.InvalidOperationException : Entity JsonEntityNested is required but the JSON element containing it is null.

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

No branches or pull requests

1 participant