rsql-parser icon indicating copy to clipboard operation
rsql-parser copied to clipboard

Support enumeration fields

Open drenda opened this issue 5 years ago • 1 comments

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

drenda avatar Jun 28 '19 10:06 drenda

you could have added a stack trace. we use tennaito/rsql-jpa and no problems with @Enumerated @Columns 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

odemura avatar Apr 02 '21 13:04 odemura