tkaczmarzyk / specification-arg-resolver

An alternative API for filtering data with Spring MVC & Spring Data JPA
Apache License 2.0
658 stars 150 forks source link

Fail search with an error on unknown search parameters #243

Open acfo opened 1 year ago

acfo commented 1 year ago

We have a use case where we would like to fail a search with an error if an unknown search parameter was passed to a GET or POST endpoint. Is there a way to hook into the arg resolver to throw an exception if unsupported search parameters are in the request?

Neither the annotation @JsonIgnoreProperties(ignoreUnknown = false) nor the global setting spring.jackson.deserialization.fail-on-unknown-properties=true seem to work for json bodies.