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
    Description of the body.
    Optional JSON view to apply to the body.
    boolean
    Indicates if the body is required or not.
  • Element Details

    • jsonView

      Class[] jsonView
      Optional JSON view to apply to the body.
      Default:
      {}
    • desc

      String desc
      Description of the body.
      Default:
      ""
    • required

      boolean required
      Indicates if the body is required or not.
      Default:
      true