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

fix: Support PageableDefault#value() #1700

Merged

Conversation

daniel-shuy
Copy link

@daniel-shuy daniel-shuy commented Jun 8, 2022

@PageableDefault#value is an alias for @PageableDefault#size, but currently, springdoc-openapi is only reading the default size from size, not value.

This change attempts to get the default size from size first. If it is the default value, then it will get the default size from value. I'm not sure if this is the correct precedence, anyone knows if Java annotation parsers normally give higher precedence to value or the aliased parameter?

PageableDefault#value() is an alias for PageableDefault#size()
@bnasslahsen
Copy link
Contributor

Thank you @daniel-shuy for your contribution to the project.

@bnasslahsen bnasslahsen merged commit f5208eb into springdoc:master Jun 8, 2022
@daniel-shuy daniel-shuy deleted the spring-data-pageabledefault-value branch June 8, 2022 14:31
@daniel-shuy
Copy link
Author

Thanks @bnasslahsen!

I tested configuring both size and value for PageableDefault on the same parameter, and it looks like Spring gives size the higher priority, as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants