30 lines
1010 B
Java
30 lines
1010 B
Java
package com.vxnet.pms.config;
|
|
|
|
import java.math.BigDecimal;
|
|
import org.springdoc.core.customizers.OpenApiCustomizer;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
@Configuration
|
|
public class PageableOpenApiCustomizer {
|
|
|
|
@Bean
|
|
public OpenApiCustomizer customizePageableOpenApi() {
|
|
return openApi ->
|
|
openApi
|
|
.getPaths()
|
|
.values()
|
|
.stream()
|
|
.flatMap(pathItem -> pathItem.readOperations().stream())
|
|
.forEach(operation -> {
|
|
if (operation.getParameters() != null) {
|
|
operation
|
|
.getParameters()
|
|
.stream()
|
|
.filter(parameter -> parameter.getName().equals("size"))
|
|
.forEach(parameter -> parameter.getSchema().setMinimum(BigDecimal.ZERO));
|
|
}
|
|
});
|
|
}
|
|
}
|