Open korygin opened 1 year ago
@korygin Thanks for reporting the issue. I don't believe we support the both odata.bind
and nested inline collection presentation for the same property. Does it work if you only have the nested inline collection?
Yes, it works unless both are specified.
Assemblies affected Microsoft.AspNetCore.OData, Version=8.0.12.0
Describe the bug. When inserting a new entity with a POST request, related entities MAY be specified using the same representation as for an expanded navigation property or a bind operation: http://docs.oasis-open.org/odata/odata-json-format/v4.0/cs01/odata-json-format-v4.0-cs01.html#_Toc365464707. However, if both are present in the request's body, ODataEdmTypeDeserializer only de-serializes related resources represented by bind operations and ignores expanded entities.
Reproduce steps Consider the following HTTP POST request payload:
In this example, the new pipeline entity is created with 2 related pipes: the first pipe already exists and is represented by the bind operation and the second pipe should be created using deep insert operation. However, after the pipeline entity is de-serialized, its Pipes navigation property contains only one related pipe instance represented by the bind operation with just id populated. The second pipe is not present in the Pipes collection.
Data Model Because our EDM model is dynamic we use untyped data model represented by EdmEntityObject / EdmComplexObject objects. CLR types are not used.
EDM (CSDL) Model
Request/Response
Expected behavior I would expect the Pipes navigation property to contain expanded Pipe entity after de-serialization.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Please share your call stack or any error message Add any other context about the problem here.