Annotation Interface Patch


@Target(METHOD) @Retention(RUNTIME) @Documented public @interface Patch
Annotation to mark a method as handling HTTP PATCH requests.

PATCH requests are used to apply partial updates to existing resources. Unlike PUT requests that replace the entire resource, PATCH only modifies the specified fields while leaving other fields unchanged.

Path Configuration: The annotation value specifies the path pattern for this endpoint, which is combined with the HttpEndpoint class-level path prefix to form the complete URL.

Request Bodies: PATCH methods typically include request bodies with the partial data to be updated. The request body parameter must come last in the parameter list when combined with path parameters.

Path Parameters: Use {paramName} in the path to identify the specific resource to update. These can be combined with request body parameters.

Response Types: PATCH methods typically return the updated resource, a success confirmation, or 200 OK responses. Use HttpResponses.ok() for standard update responses.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • value

      String value
      Default:
      ""