-
-
Notifications
You must be signed in to change notification settings - Fork 160
Closed
Labels
Description
DESCRIPTION
When using EF OwnsOne/OwnsMany properties for nested or complex data structures/mappings JADNC 5 returns inconsistent results, nulls, or errors depending on use of include or sparse fieldsets.
- For regular requests with no sparse fields and no includes, properties mapped with
OwnsOneact as expected - When includes for other models are requested properties mapped with
OwnsOnewill return as null or invalid results - When using sparse fields on a resource with
OwnsOnemappings, a tracking error is thrown.
STEPS TO REPRODUCE
Full reproduction project: https://github.com/rtablada/JsonApiDotnetExamples
EXPECTED BEHAVIOR
Attrs which expose properties from OwnsOne should allow regular Attr behavior and work with include and fields as any other exposed attribute
ACTUAL BEHAVIOR
OwnsOne Attr properties...
- return expected result with no complex query string
- return null when
includeoperations are requested from query string - error when sparse fields are requested for
OwnsOneattribute
VERSIONS USED
- JsonApiDotNetCore version: 5.1.2
- ASP.NET Core version: 7.0.0
- Entity Framework Core version: 7.0.4
- Database provider: PG for example project ☝🏽 (occurs with MSSQL as well)