Annotation Interface BodyParam


@Retention(RUNTIME) @Target(PARAMETER) public @interface BodyParam
Injects a field from a JSON request body into a handler method parameter.

If no explicit field name is provided, the method parameter name is used. Nested JSON properties may be addressed using dot or slash notation.

Example:

@HandlePost("/bookings")
BookingId createBooking(@BodyParam HotelId hotelId,
                        @BodyParam RoomId roomId,
                        @BodyParam BookingDetails details) { ... }
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Body field name.
  • Element Details

    • value

      String value
      Body field name. If left empty, it defaults to the method parameter's name.
      Default:
      ""