fixes #2816: Set the response version to delta response and delta patch response - #2829
Conversation
…delta patch, but not any time for delta response payload
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
|
||
| if (serializer.ODataPayloadKind == ODataPayloadKind.Delta) | ||
| // Set the response version to v4.01 when the request is a delta patch, but not any time we write a delta response payload. | ||
| if (serializer.ODataPayloadKind == ODataPayloadKind.Delta && internalRequest.Method == ODataRequestMethod.Patch) |
There was a problem hiding this comment.
What's the internal request method of a normal delta response? Isn't it Patch also?
There was a problem hiding this comment.
or this is for other methods like GET etc
There was a problem hiding this comment.
PATCH is the verb used when the client is doing a delta (aka bulk) update.
The delta response payload is also used when the client retrieves changes using the deltaLink using GET.
Bulk updates are only supported for 4.01, so it's appropriate for the response from a delta update to be 4.01, but a request to get changes (which also returns in delta format) has been around since 4.0, and is valid in either 4.0 or 4.01 format.
…a patch response (OData#2829) * fixes OData#2816: Set the response version to v4.01 when the request is a delta patch, but not any time for delta response payload * Fix the failing test cases * Fix the failing test case * Remove unused codes
Issues
This pull request fixes #2816.
Description
Currently, ODataVersion.4.01 is hard coded for all delta response. So, customer can't switch between 4.0 and 4.01.
However, it may be true for delta patch since it's only included in OData version 4.01, but not in OData version 4.0. For other delta responses, it should be valid in both versions.
This PR is to change to 4.01 only for delta patch response but use the version setting for other delta response.
Checklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.