Skip to content

Nested entity property not returned in Created(201) #1701

Open
@denious

Description

@denious

Unable to return a nested entity property as part of a Created(201) response.

Assemblies affected

Microsoft.AspNetCore 2.1.6
Microsoft.AspNetCore.Mvc 2.1.3
Microsoft.AspNetCore.OData 7.1.0

Reproduce steps

  • Create a blank web API project and import OData packages
  • Add two entity types, A and B, and a complex type C
  • Add properties reference B and C inside A
  • Add a CRUD controller for A
  • Send a POST request for A and return the created object using the built-in Created() method
  • The returned JSON is populated for the complex type C but the entity type B property is not returned

Expected result

The returned JSON is populated for both the complex type C and the entity type B properties

Actual result

The returned JSON is populated for the complex type C but the entity type B property is not returned

Additional detail

I tried playing with the expand option (fluent syntax, property decorator, automatic expansion) but that doesn't affect the response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions