Skip to content

Conversation

newtork
Copy link
Contributor

@newtork newtork commented Aug 18, 2025

Context

Addresses #870

We've been adding the incorrect HTTP request header when supplying the entity version ETag.

Feature scope:

  • Fix for bound actions with single value return type
  • Fix for bound actions with multi value return type
  • Ignore bound functions, since according to OData standard they must be free of side-effects

ETags in OData v4

  • Clients can then use them in conditional requests (e.g. If-Match / If-None-Match headers) when doing PATCH, DELETE, or other state-modifying operations.

Affected API (Example)

No change for user code.

var service = new DefaultSdkGroceryStoreService();

var customer = Customer.builder().id(1337).build();
customer.setVersionIdentifier("123"); // implicit

var  historyItems = service.forEntity(customer)
        .applyAction(
            Customer
                .filterPurchaseHistory(
                    List.of(Receipt.builder().customerId(1337).id(4242).build()),
                    List.of("milk", "eggs"),
                    List.of(ProductCategory.DAIRY, ProductCategory.MEAT),
                    dateRange))
        .execute(destination);

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Documentation updated
  • Release notes updated

@newtork newtork marked this pull request as draft August 18, 2025 09:22
@newtork newtork added the please review Request to review a pull request label Aug 19, 2025
@newtork newtork marked this pull request as ready for review August 19, 2025 14:29
@newtork newtork changed the title fix: (OData v4) Use correct ETag / If-Match header for bound actions and -functions fix: (OData v4) Use correct ETag / If-Match header for entity bound actions Aug 19, 2025
newtork and others added 3 commits August 21, 2025 10:17
…ns-functions' into odata-v4/fix-etag-on-bound-actions-functions
Copy link
Member

@Jonas-Isr Jonas-Isr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@newtork newtork merged commit 05011f8 into main Aug 27, 2025
14 checks passed
@newtork newtork deleted the odata-v4/fix-etag-on-bound-actions-functions branch August 27, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please review Request to review a pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants