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

Write constraint only applied to "id" in the path, but not in the body #635

Closed andrus closed 1 year ago

andrus commented 1 year ago

An ID write constraint is applied inconsistently:

// works - correct
AgJaxrs.create(E8.class, config)
        .byId(id)
        .writablePropFilter(E8.class, b -> b.empty())
        .sync(requestBody);
// ignored - incorrect
AgJaxrs.create(E8.class, config)
        .writablePropFilter(E8.class, b -> b.empty())
        .sync(requestBody);