Skip to content

Support property without property value #1301

@xuzhg

Description

@xuzhg

Assemblies affected
Which assemblies and versions are known to be affected e.g. ASP.NET Core OData 9.x

Describe the bug

ODL supports to read the property without value. Here's an example:

{
    "@odata.context":"http://localhost/$metadata#Customers/$entity",
    "CustomerID": 17,
    "Name@Custom.PrimitiveAnnotation":123,
    "Name@Custom.BooleanAnnotation":true,
    "Location": { "Street":"154TH AVE"}
}

where, the property 'Name' only contains the instance annotations.

ODL can read the above properties and output the 'ODataReaderState.NestedPropertyInfo' in the reading pipeline.

The ASP.NET Core OData payload reading process doesn't handle the "NestedPropertyInfo", that means the properties without value are ignored. The result is that the end user can't handle such properties even he customizes the resource deserializer.

Additional context
Be noted, so far ODL 8.1 also reads the 'primitive type property without value into the 'ODataResourceBase.Properties', but not for other type properties.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions