Wie setze ich die Standard -Pagable -Abfrageparameter auf der UI der Swagger ein?Java

Java-Forum
Anonymous
 Wie setze ich die Standard -Pagable -Abfrageparameter auf der UI der Swagger ein?

Post by Anonymous »

Ich habe REST -API -Endpunkte mit Spring Boot entwickelt. Hier ist die Controller -Klasse: < /p>

Code: Select all

@RestController
@RequestMapping(
path = "/api/products",
produces = {MediaType.APPLICATION_JSON_VALUE})
@AllArgsConstructor
@Validated
public class ProductController {

private ProductService productService;

@GetMapping
public ResponseEntity
> getProducts(
@RequestParam(required = false) BigDecimal minPrice,
@RequestParam(required = false) BigDecimal maxPrice,
@PageableDefault(size = 100) Pageable pageable) {
PageDto products = productService.findProducts(minPrice, maxPrice, pageable);
return ResponseEntity.status(HttpStatus.OK).body(products);
}
// other functions here
}
Wenn ich http: // localhost: 8080/swagger-ui/index.html öffne, sehe ich hier:

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post