Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
shihyuho authored May 22, 2017
1 parent 65fc4c6 commit 12f0d48
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,25 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
- `@FilterOutAllExcept` - Same as `SimpleBeanPropertyFilter.filterOutAllExcept(...)`

```java
@Controller
@RestController
public class SomeController {

@SerializeAllExcept({"someField", "anotherField"})
@RequestMapping(value = "/without/some-fields", method = RequestMethod.GET)
@ResponseBody
public SomeObject withoutSomeFields() {
return someObject;
}

@FilterOutAllExcept({"someField", "anotherField"})
@RequestMapping(value = "/only/some-fields", method = RequestMethod.GET)
@ResponseBody
public SomeObject onlySomeFields() {
return someObject;
}
}
```

> [SimpleBeanPropertyFilter javadoc](https://fasterxml.github.io/jackson-databind/javadoc/2.3.0/com/fasterxml/jackson/databind/ser/impl/SimpleBeanPropertyFilter.html)
### Custom annotation

You can annotate a custom annotation:
Expand Down Expand Up @@ -134,12 +134,11 @@ public DynamicFilterResponseBodyAdvice dynamicFilterResponseBodyAdvice() {
and then use it for you controller as follows:

```java
@Controller
@RestController
public class SomeController {

@WithoutAuditingFields
@RequestMapping(value = "/some-path", method = RequestMethod.GET)
@ResponseBody
public SomeObject getSomeObject() {
return someObject;
}
Expand Down

0 comments on commit 12f0d48

Please sign in to comment.