Skip to content

sdqali/spring-json-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Response Filter

This is a sample implementation of filtering JSON responses at the web layer in a spring application. For an API that consumes data from a data layer with the following structure, it supports queries of the kind /data?key1=foo&key2=bar&key5=zoo, with a simple annotation.

[
    {
      key1: "foo",
      key2: "foo",
      key3: "foo",
      ...
    }, {
      key1: "foo",
      key2: "foo",
      key3: "foo",
      ...
    }, {
      key1: "foo",
      key2: "foo",
      key3: "foo",
      ...
    }
    ...
]

For a detailed explanation, see my blog post.