Annotation Interface RequestBody


@Target(PARAMETER) @Retention(RUNTIME) @Documented public @interface RequestBody
Annotation indicating that the request's body should be parsed in a request mapping and made available in the associated method parameter.

Example

 
  @ApiEndpoint("/api")
  public class MyController {

      // Incoming request looks like "/api/user" and contains an HTTP JSON body
      @PostMapping("/user")
      public void createNewUser(@RequestBody UserInfo userInfo) {
          // Create the new user using the populated userInfo object.
      }
  }
 
 
Since:
1.0
Version:
2023-02-16
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional JSON view to apply to the body.
  • Element Details

    • value

      Class[] value
      Optional JSON view to apply to the body.
      Default:
      {}