agrestio / agrest

Server-side Java REST Framework for easy access to data graphs from various backends
https://agrest.io
Apache License 2.0
80 stars 34 forks source link

EntityUpdate-style endpoints behave differently from String and List<EntityUpdate> #609

Closed andrus closed 1 year ago

andrus commented 1 year ago

From these 3 styles of update endpoints:

public SimpleResponse sync(String requestBody)
public SimpleResponse sync(EntityUpdate<T> u)
public SimpleResponse sync(List<EntityUpdate<T>> us)

The first and third variants treat an empty payload as an empty list of updates. While the second one fails with 400 No update. We need to align the behavior between the styles. I think treating this input as valid ("empty list of updates") is the way to go.