errorMessage": "Name for argument of type [java.lang.String] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag.", "httpStatus": "BAD_REQUEST"

haruceki·2024년 7월 24일

   @GetMapping("/api/search")
    @ResponseBody
    public List<ItemDto> getItems(@RequestParam("query") String query) {
        return itemSearchService.searchItems(query);
    }

@RequestParam의 괄호안에 query 변수를 명시해 주지 않아서 프론트단에서 생긴 에러이다.
스프링 버전에 따라 괄호안의 변수명 지정이 필요하다고 한다.

profile
희망도 절망도 없이 매일 코딩을 한다.

0개의 댓글