You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebApi v7 doesn't support property instance annotations when the property value is not present.
Assemblies affected
OData WebApi v7
Reproduce steps
Considering this payload, where references is an OpenComplexTypeObject. When this payload is passed, we expect the webapi library to identify the key "https://a/task@task.task" as a property instance annotation.
However, the v7 library is missing this feature and returns nothing for the property Instance Annotations.
The InstanceAnnotations in the ODataResourceWrapper of the ODataResourceDeserializer, should populate the InstanceAnnotations for the property.
Actual result
ODataResourceWrapper.ResourceBase.Properties.InstanceAnnotations.Count = 0 for the property "references"
and the request passes with the response showing "details": null
Additional detail
In WebApi lib v6, the ODataResourceDeserializer considered references as a complex property and threw an error like: ODataJsonLightPropertyAndValueDeserializer_ComplexValuePropertyAnnotationWithoutProperty
However, in v7, references is considered as a resource. The deserializer is not sure how to map the annotation as the property value is missing.
I was informed that V8 has a fix for this. So, porting that to v7 would be a quick fix.
The text was updated successfully, but these errors were encountered:
WebApi v7 doesn't support property instance annotations when the property value is not present.
Assemblies affected
OData WebApi v7
Reproduce steps
Considering this payload, where references is an OpenComplexTypeObject. When this payload is passed, we expect the webapi library to identify the key "https://a/task@task.task" as a property instance annotation.
However, the v7 library is missing this feature and returns nothing for the property Instance Annotations.
Expected result
We expect the request to fail with a BadRequest like it did in v6.
(or)
When a prefer header is sent with the request,
The InstanceAnnotations in the ODataResourceWrapper of the ODataResourceDeserializer, should populate the InstanceAnnotations for the property.
Actual result
ODataResourceWrapper.ResourceBase.Properties.InstanceAnnotations.Count = 0 for the property "references"
and the request passes with the response showing
"details": null
Additional detail
In WebApi lib v6, the ODataResourceDeserializer considered
references
as a complex property and threw an error like:ODataJsonLightPropertyAndValueDeserializer_ComplexValuePropertyAnnotationWithoutProperty
However, in v7,
references
is considered as a resource. The deserializer is not sure how to map the annotation as the property value is missing.I was informed that V8 has a fix for this. So, porting that to v7 would be a quick fix.
The text was updated successfully, but these errors were encountered: