Skip to content

example of a web application exposing filter API built with specification-arg-resolver

Notifications You must be signed in to change notification settings

tkaczmarzyk/specification-arg-resolver-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

some examples for SpecificationArgumentResolver

This is a simple Spring Boot project which presents Specification Argument Resolver library.

It is an executable jar with embedded H2 db, so just build it with Maven and explore the API. You will find some samples below:

  1. Get all customers:

    curl http://localhost:8080/customers

  2. Delete a customer

    curl -X DELETE http://localhost:8080/customers/3

    it will perform a soft delete, which you can verify by getting all customers again -- the deleted customer will be still there, but with deleted = true flag. As you will see in subsequent points, specification-based query methods will filter it out.

  3. Filter customers (include only not deleted ones) by first name and gender (optionally):

    curl http://localhost:8080/customers?firstName=ar curl 'http://localhost:8080/customers?firstName=ar&gender=MALE'

  4. Filter by name (either first or last, case insensitive) with paging:

    curl 'http://localhost:8080/customers?name=l&page=0&size=2&sort=id'

About

example of a web application exposing filter API built with specification-arg-resolver

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages