Skip to content

Commit

Permalink
Merge pull request #85 from lotteon2/fix/search-from-gpt
Browse files Browse the repository at this point in the history
[FIX] input validation
  • Loading branch information
CokeLee777 authored Jan 28, 2024
2 parents 78dc45f + b6520e1 commit e8b4937
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;

@RestController
@RequestMapping("/products")
@RequiredArgsConstructor
Expand Down Expand Up @@ -48,7 +51,7 @@ ResponseEntity<ReadProductSliceResponse> readProductSlice(
}

@GetMapping("/search")
ResponseEntity<ReadProductSearchResponse> searchProducts(@RequestParam String query) {
ResponseEntity<ReadProductSearchResponse> searchProducts(@Valid @NotBlank @RequestParam String query) {
return ResponseEntity.status(HttpStatus.OK).body(productFacade.searchProducts(query));
}

Expand Down

0 comments on commit e8b4937

Please sign in to comment.