Delta<Entity> Path Request unable to serialize in case properties are sent in different order. #1523
Replies: 13 comments
-
@xuzhg @gathogojr @ElizabethOkerio @gathogojr -- Tagging top contributors in hope to get right traction. |
Beta Was this translation helpful? Give feedback.
-
@manikantsinghms When odata.streaming=true, OData writes an ordered payload. In an ordered payload, the OData JSON specification requires that the id control information, if present, must immediately follow the @removed control information. Spec reference |
Beta Was this translation helpful? Give feedback.
-
@ElizabethOkerio, but client is not sending us "odata.streaming=true" in content-type headers, then why do we expect it to be ordered payload? Why Odata is failing to read the payload correctly? Is there a configuration to manage it? "OData writes an ordered payload" this should be applicable for the response only, right? |
Beta Was this translation helpful? Give feedback.
-
@manikantsinghms Can you check the request being sent. |
Beta Was this translation helpful? Give feedback.
-
Hi @ElizabethOkerio, There is no header "streaming=true" PATCH https://graph.microsoft.com/v1.0/solutions/backupRestore/sharePointProtectionPolicies/7aa910c1-af61-4b78-b921-a023d5642c1f HTTP/1.1 { |
Beta Was this translation helpful? Give feedback.
-
Interesting. Interesting — it looks like OData automatically appends some default media type parameters to the response, even if the client didn’t explicitly request them. Typical defaults include:
If you need different values, you can override them either by specifying the desired parameters in the client’s |
Beta Was this translation helpful? Give feedback.
-
I tried specifying client-headers yet it returns odata.streaming=true. Additionally, if ODATA itself adds streaming headers, shouldn't this be a documentation bug? |
Beta Was this translation helpful? Give feedback.
-
Note that specifying streaming=true in the response payload indicates that the response is ordered. We add that because the library always writes ordered responses. The lack of streaming=true in the request (or explicitly stating streaming=false) tells the service whether the request is ordered. Regarding the The Microsoft.OData.Core library today requires that the This requirement follows the protocol for ordered payloads: By protocol, if the client does not specify odata.streaming=true, then the service should not require this ordering. However, our code tries to determine whether the json object represents a deleted entity early on (before reading other properties) and, especially since deleted entries can contain other properties (including nested properties/resources) it can be expensive to buffer all of the resource (and nested resources) in memory in order to determine whether or not it contains the We can look to see if there is a way we can at least cover this case (id before Do you know how the update payload is being generated? Is it possible to generate it in the correct order (with |
Beta Was this translation helpful? Give feedback.
-
the payload is getting generated by microsoft.sdk powershell. |
Beta Was this translation helpful? Give feedback.
-
@mikepizzo , Please let me know if this is going to be supported if yes, by when we an expect it be fixed. Else we can also, we should update the ODATA document that incase of deleted entities, only ordered payload is supported. |
Beta Was this translation helpful? Give feedback.
-
@mikepizzo , could you please provide an update on my queries. |
Beta Was this translation helpful? Give feedback.
-
I believe that, following our triage last week, @WanjohiSammy was going to follow up. This is related to OData/odata.net#3069, which was created by @xuzhg. That PR was put on hold because the initial implementation read/buffered too much of the payload, and the client was able to change the ordering of the properties when generating the request payload. OData/odata.net#3069 (comment) suggests that we could expand the existing logic that reads all of the control information up to the first property, but that would have to be amended to read all of the control information and key properties up to the first non-control/non-key property in order to determine whether or not this was a deleted resource. That would address this case as well without the performance issues of having to read to the end in search of certain control information. Let's use OData/odata.net#3069 to track this issue. @marabooy for awareness. |
Beta Was this translation helpful? Give feedback.
-
Adding + @rushikesh ***@***.***>, @diksha ***@***.***>
…________________________________
From: Michael Pizzo ***@***.***>
Sent: Tuesday, September 16, 2025 10:18 PM
To: OData/AspNetCoreOData ***@***.***>
Cc: Manikant Singh ***@***.***>; Mention ***@***.***>
Subject: Re: [OData/AspNetCoreOData] Delta<Entity> Path Request unable to serialize in case properties are sent in different order. (Discussion #1523)
I believe that, following our triage last week, @WanjohiSammy<https://github.com/WanjohiSammy> was going to follow up.
This is related to OData/odata.net#3069<OData/odata.net#3069>, which was created by @xuzhg<https://github.com/xuzhg>. That PR was put on hold because the initial implementation read/buffered too much of the payload, and the client was able to change the ordering of the properties when generating the request payload.
OData/odata.net#3069 (comment)<OData/odata.net#3069 (comment)> suggests that we could expand the existing logic that reads all of the control information up to the first property, but that would have to be amended to read all of the control information and key properties up to the first non-control/non-key property in order to determine whether or not this was a deleted resource. That would address this case as well without the performance issues of having to read to the end in search of certain control information.
Let's use OData/odata.net#3069<OData/odata.net#3069> to track this issue. @marabooy<https://github.com/marabooy> for awareness.
—
Reply to this email directly, view it on GitHub<#1523 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BDKSSEP5FR5VPR4UWC6X53L3TA5NPAVCNFSM6AAAAACFW42ZX2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTINBRHA3TSOI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Failing request:
{
"siteProtectionUnits@delta": [
{
"id": "MmI5NWUyZmItNjBlZC00ZmNkLTkxMzQtNWU3MDlkZjY0OGM2XzE=",
"@removed": {
"reason": "changed"
}
}
],
"displayName": "SP Policy 6 Shell 1"
}
Success Request:
{
"siteProtectionUnits@delta": [
{
"@removed": {
"reason": "changed"
},
"id": "MmI5NWUyZmItNjBlZC00ZmNkLTkxMzQtNWU3MDlkZjY0OGM2XzE="
}
],
"displayName": "SP Policy 6 Shell 1"
}
Based on the order of "Id"/"@removed" property, our service is not able to read the payload correctly.
Controller
public class SharePointProtectionPoliciesController : ProtectionControllerBase
{
public async Task Patch([FromRoute] string key, [FromBody] Delta sharePointProtectionPolicy)
{
return await PatchPolicy(key, PolicyType.SharePoint, sharePointProtectionPolicy);
}
}
From the ODATA official documentation we observed that, it's required to have properties in specific order for ordered payload but in other cases nothing is mentioned as such.
We also don't have any specified in out controller to either enable or disable ordered payload support.
However, I get to see "odata.streaming=true" in the response.
Could you please help us understand the issue and how can we fix it.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions