Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring pageable support #2943

Closed
wants to merge 3 commits into from
Closed

Spring pageable support #2943

wants to merge 3 commits into from

Conversation

Zomzog
Copy link

@Zomzog Zomzog commented Mar 17, 2019

What's this PR do/fix?

Add spring Pageable configuration support for #2761

Are there unit tests? If not how should this be manually tested?

The unit test is partial

Any background context you want to provide?

I've added a hack for adding description and example. I think it's useful but I can remove it.

What are the relevant issues?

WIthout this config, generated swagger contain invalid fields and generate noncompilable code with openapi-generator

@codecov
Copy link

codecov bot commented Mar 17, 2019

Codecov Report

Merging #2943 into master will increase coverage by 22.86%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master    #2943       +/-   ##
=============================================
+ Coverage     70.13%   92.99%   +22.86%     
- Complexity      191     3469     +3278     
=============================================
  Files           503      376      -127     
  Lines         14822     9242     -5580     
  Branches       1308      758      -550     
=============================================
- Hits          10395     8595     -1800     
+ Misses         3831      462     -3369     
+ Partials        596      185      -411     
Impacted Files Coverage Δ Complexity Δ
...web/configuration/SpringPageableConfiguration.java 100.00% <100.00%> (ø) 5.00 <5.00> (?)
...ngfox/documentation/oas/mappers/LicenseMapper.java 0.00% <0.00%> (-50.00%) 0.00% <0.00%> (ø%)
...tation/schema/JaxbPresentInClassPathCondition.java 50.00% <0.00%> (-50.00%) 3.00% <0.00%> (+3.00%) ⬇️
...n/java/springfox/documentation/service/Server.java 0.00% <0.00%> (-40.63%) 0.00% <0.00%> (ø%)
...umentation/oas/mappers/VendorExtensionsMapper.java 0.00% <0.00%> (-27.59%) 0.00% <0.00%> (ø%)
...entation/spi/service/contexts/SecurityContext.java 50.00% <0.00%> (-23.34%) 5.00% <0.00%> (+5.00%) ⬇️
.../web/readers/parameter/ParameterDefaultReader.java 87.50% <0.00%> (-12.50%) 6.00% <0.00%> (+6.00%) ⬇️
...cumentation/schema/property/XmlPropertyPlugin.java 81.63% <0.00%> (-10.31%) 14.00% <0.00%> (+14.00%) ⬇️
...ation/spring/web/scanners/ComparisonCondition.java 52.94% <0.00%> (-9.56%) 5.00% <0.00%> (+5.00%) ⬇️
...ervice/contexts/OperationModelContextsBuilder.java 94.33% <0.00%> (-5.67%) 16.00% <0.00%> (+16.00%) ⬇️
... and 432 more

@codecov
Copy link

codecov bot commented Mar 17, 2019

Codecov Report

Merging #2943 into master will increase coverage by 0.03%.
The diff coverage is 92.85%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2943      +/-   ##
============================================
+ Coverage     94.32%   94.35%   +0.03%     
- Complexity     3239     3246       +7     
============================================
  Files           364      365       +1     
  Lines          8381     8409      +28     
  Branches        619      619              
============================================
+ Hits           7905     7934      +29     
  Misses          318      318              
+ Partials        158      157       -1
Impacted Files Coverage Δ Complexity Δ
...web/configuration/SpringPageableConfiguration.java 92.85% <92.85%> (ø) 5 <5> (?)
...ntation/builders/AlternateTypePropertyBuilder.java 100% <0%> (+11.11%) 12% <0%> (+2%) ⬆️

@Zomzog Zomzog force-pushed the 2761 branch 2 times, most recently from 94239aa to e8921bc Compare June 8, 2019 07:48
@dilipkrish dilipkrish added the PR label Aug 3, 2019
@dilipkrish dilipkrish added this to the 3.0 milestone Aug 3, 2019
Copy link
Member

@dilipkrish dilipkrish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this neat PR! I do have a couple of questions/changes

@@ -16,8 +16,10 @@ dependencies {
compile project(':springfox-spi')
compile project(':springfox-schema').sourceSets.main.output
compile project(':springfox-spring-web')
compile project(':springfox-swagger-common')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this dependency?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for adding annotation but maybe I can remove them.

compile "com.athaydes.rawhttp:rawhttp-core:2.0"
compileOnly "org.springframework.restdocs:spring-restdocs-mockmvc:2.0.3.RELEASE"
compileOnly "org.springframework.data:spring-data-rest-webmvc:$springDataRest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be provided?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure to understand what you mean by "provided".

@Zomzog
Copy link
Author

Zomzog commented Jul 6, 2020

@dilipkrish I've rebased it, I will try to answer faster this time.

@dilipkrish dilipkrish removed this from the 3.0 milestone Jul 14, 2020
@ryandanielspmc
Copy link

ryandanielspmc commented Oct 30, 2020

@Zomzog @dilipkrish One issue I see here is that this code uses the word limit, whereas, according to this article: https://www.baeldung.com/spring-data-web-support and this article: https://reflectoring.io/spring-boot-paging/, the parameter created by spring is called size.

@Zomzog
Copy link
Author

Zomzog commented Oct 30, 2020

@Zomzog @dilipkrish One issue I see here is that this code uses the word limit, whereas, according to this article: https://www.baeldung.com/spring-data-web-support and this article: https://reflectoring.io/spring-boot-paging/, the parameter created by spring is called size.

good point, I've fixed the name.

@Zomzog Zomzog closed this Oct 26, 2022
@Zomzog Zomzog deleted the 2761 branch October 26, 2022 22:15
@Zomzog Zomzog restored the 2761 branch October 26, 2022 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants