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

Exp.keyValue() only works with a narrow range of value types #601

Closed andrus closed 1 year ago

andrus commented 1 year ago

Testing 5.0.M10, and Exp.keyValue() fails e.g. if the value is a LocalDate. I am committing a disabled test here to demonstrate the problem.

io.agrest.AgException: Can't convert value to an expression argument
    at io.agrest.AgException.internalServerError(AgException.java:106)
    at io.agrest.exp.parser.ExpScalar.of(ExpScalar.java:61)
    at io.agrest.protocol.Exp.keyValue(Exp.java:39)

One possible way to fix it is to treat the value as a parameter instead of scalar.