Open cbornet opened 8 years ago
@diyfr
Generate code works [https://github.com/diyfr/swagger-codegen/commit/e908589f2b8cda673e3c85c42ac309916ab41a6f](first commit x-spring-pageable). What dependency used for your test ? I used spring-boot-starter-data-jpa , perhaps this is the problem?
EDIT 2: add to application propeties
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
instead of
@SpringBootApplication(exclude = { org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration.class,
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration.class})
@diyfr Don't use spring-boot-starter-data-jpa, use only spring-data-commons
As for naming I prefer "x-spring-paginated" than "x-spring-pageable"
Also I tested the the plugin for Pageable parameters and it worked great. I find it cleaner than @ApiImplicitParam everywhere in the code.
@cbornet i use x-spring-pageable because is the know spring component. And plugin need to rebuild springfox or can it in springboot project ?
No you can just include the class in your project and a @Bean in a @Configuration to activate it.
Yes Pageable is the name of the spring-data component used to implement pagination (you also need Page) and it doesn't describe the nature of the operation which is that it is "paginated using spring pagination"
@cbornet ok for x-spring-paginated. I do not know if I'll have time for the plug-in today
To follow the discussion from #3133 The idea is to generate Page/Pageable if the operation has a "x-spring-paginated" vendor-extension.
I just tried
in spring-boot after including spring-data-commons and didn't have any issue. I didn't have to configure any datasource.