@JsonView how to use with @RequestBody

user3378876

I want to add JsonView functionality to control input of my application. And I find that I can use this annotation with RequestBody in Spring 4.1.0.RELEASE but get error this annotation not allowed here

 public ResponseEntity<User> update(@RequestHeader(value="Access-key") String accessKey,
                                         @RequestHeader(value="Secret-key") String secretKey,
                                         @JsonView(View.Summary.class) @RequestBody User user) throws Exception{
Bohuslav Burghardt

@JsonView annotation is supported on method parameters since version 2.5 of Jackson. You must therefore upgrade your Jackson dependency for it to work.

Source: Github

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to custom convert String to enum in @RequestBody?

How to pass @RequestBody parameter of controller using MockMVC

Can't use @RequestBody with PostMapping only with GetMapping

How to serialize using @Jsonview with nested objects

How to use Spring MVC @JsonView when returning an object hierarchy from a Rest Controller

Spring Controller: use domain objects as @RequestBody

How to Apply @JsonView only for children of a Object with Spring RestController - serialization?

How to use @RequestBody in Spring Webflux and avoid IllegalStateException?

Can't use Apache Camel requestBody properly

How to whitelist/blacklist parameters in @RequestBody

How can I use @JsonView / @JsonBackReference / @JsonIdentityInfo to serialize desired child elements depending on scenario

How to use @RequestBody and @RequestParam together

Use Spring @RestController without implicit @RequestBody

How to use Spring MVC @JsonView when returning an object hierarchy from a Rest Controller

spring MVC use @JsonView on spring-data Page

Jackson - how to find active JsonView at runtime

How to change JsonView for specific properties

How can i use requestBody to upload an image as binary in phoenix/Elixir

How to negate @JsonView?

How to combine @JsonView with @JsonProperty?

How to replace deprecated okhttp.RequestBody.create()

springboot, how to valid @RequestBody

Spring security : How to use @RolesAllowed with @RequestBody

Can I specify the jackson @JsonView to use for method result transformation in RestEasy?

Use @JsonView to exclude (like @JsonIgnore) with play frameworks default json writer?

How to intergrate @JsonView and HATEOAS in spring

How to pass 2 objects in @RequestBody?

How to limit fields that map in @RequestBody

Use @RequestBody to map JSON to a class with @Builder