Skip to content

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
Collaborator

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.

2 participants