rsql-parser
rsql-parser copied to clipboard
Support enumeration fields
I'm using Spring Boot, Spring Data Rest and this library. I followed this tutorial https://www.baeldung.com/rest-api-search-language-rsql-fiql and everything works fine.
I've a problem when a field is an enumeration. In this query:
http://localhost:8082/api/v1/contacts/search?query=type==CUSTOMER
type field is an enumeration defines as:
```
@NotNull @Enumerated(EnumType.STRING) @Column(nullable = false, columnDefinition = "VARCHAR(30) DEFAULT 'CUSTOMER'") private ContactType type = ContactType.CUSTOMER;
how am I supposed to make the filter work?
Thanks
you could have added a stack trace.
we use tennaito/rsql-jpa and no problems with @Enumerated @Column
s whatsoever,
and it does nothing special for them at all
https://github.com/tennaito/rsql-jpa/blob/master/src/main/java/com/github/tennaito/rsql/jpa/PredicateBuilder.java#L259
https://github.com/tennaito/rsql-jpa/blob/master/src/main/java/com/github/tennaito/rsql/jpa/PredicateBuilder.java#L390