-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PATCH Member of a Collection Sends all Fields Instead of Changed Fields #883
Comments
Hi @SpaceCondor, thanks for reaching our to us. I will reach out to our PO (@newtork) to discuss whether we can find time to implement this feature. Thanks and best regards, |
If needed I can construct the request directly as opposed to utilizing the cloud SDK so it is more of an inconvenience. Within SAP B1, the Service Layer will often produce errors when doing PATCH requests and sending entire objects. |
Hi @SpaceCondor, Currently we are in preparation for the upcoming next major release. This will likely keep us busy within the next weeks. Please let me know in case this request is much more urgent and requires higher priority. The following request could be used as workaround while leveraging our Generic OData Client: final String jsonPayload = "{"
+ " \"OrderLines\": ["
+ " {"
+ " \"LineNum\": 2,"
+ " \"Price\": 100"
+ " }"
+ " ]"
+ "}";
final ODataEntityKey entityKey = ODataEntityKey.of(Collections.singletonMap("OrderId", 12345), ODataProtocol.V2);
final ODataRequestUpdate request = new ODataRequestUpdate(
"/service/path/", // service path
"Orders", // entity set name
entityKey,
jsonPayload,
UpdateStrategy.MODIFY_WITH_PATCH,
null, // no version identifier
ODataProtocol.V2);
final HttpDestination httpDestination = DestinationAccessor.getDestination("MyDestination").asHttp();
final HttpClient httpClient = HttpClientAccessor.getHttpClient(httpDestination);
request.execute(httpClient); Best regards |
@newtork Thank you for the feedback and I completely understand regarding the launch of version 4 of the SDK being a priority. I will use the provided workaround for now and if it becomes more urgent I will let you know. Thanks again! |
Issue Description
When modifying a member of a collection property of an object and then issuing a PATCH request, the entire collection and all properties are sent as opposed to just the member and properties that have been updated.
A real world scenario would be updating the sales price of the second line of an order.
Example Code:
In the above scenario I'd expect to see a request like:
But instead I am getting all order lines and all fields of all order lines.
I understand that I can exclude particular fields from updates and also force include fields, but I don't think I can specify the above behavior?
The text was updated successfully, but these errors were encountered: