Open Truyaka opened 3 years ago
As I found out there is custom parameter for OpenAPI file (https://github.com/OpenAPITools/openapi-generator/pull/5022
) that allow handle Pageable in a special way. But this parameter exists only for Java Spring generator. I think this feature just need to be (re)implemented for spring-kotlin.
On our project we have a messy workaround that replaces Pageable to custom DTO. Would be nice to support Pageable natively.
I have YAML for generation:
And I have plugin for server-generation with replacement import by org.springframework.data.domain.Pageable:
And I have different code result in kotlin-spring generation:
spring generation:
There is a difference in @NotNull @ApiParam(value = "", required = true) @Valid org.springframework.data.domain.Pageable pageable and @NotNull @RequestParam(value = "pageable", required = true) pageable: Pageable
In kotlin-case expects param with "pageable"-name, BUT it's the just wrapper for params "page", "size" and "sort" that present in org.springframework.data.domain.Pageable Spring-behavior (without openapi generators) is such as "spring"-generator
And second mini-question: is there any way to use generic org.springframework.data.domain.Page with code-generation? I tried to replace by importMappings but it doesn't support generic types