Annotations & Supported Patterns

Annotations that correct the inference of the source parser and code shapes that are reliably analyzed.


Selected annotations

@SelectedRequestParam

query parameter의 key, defaultValue, required, nullable, type override

@SelectedRequestPath

path variable의 key, defaultValue, required, nullable, type override

@SelectedResponseBody

Response type and nullable override in method/local/parameter.

Annotation target

SelectedRequestParam

LOCAL_VARIABLE, PARAMETER

SelectedRequestPath

LOCAL_VARIABLE, PARAMETER

SelectedResponseBody

LOCAL_VARIABLE, PARAMETER, METHOD

Recommended route shape

java
return route()
    .nest(path("/api/member"), builder -> builder
        .nest(path("/search"), search -> search
            .GET("/get-list", accept(MediaType.APPLICATION_JSON), handler::getList)
            .GET("/get-detail/{id}", handler::getDetail))
        .POST("/create", handler::create))
    .build();

Recommended handler shape

java
public Mono<ServerResponse> getDetail(ServerRequest request) {
  String id = request.pathVariable("id");
  Mono<MemberResponse> response = service.getDetail(id);

  return ServerResponse.ok()
      .contentType(MediaType.APPLICATION_JSON)
      .body(response, MemberResponse.class);
}

Support range

© 2026 Byeolnaerim. All rights reserved.IntroductionPrivacy Policy