Repository navigation
fix(processor): document Pageable as page, size and sort in OpenAPI - #8
Merged
Merged
Conversation
With pageable = true the generated findAll(Pageable pageable) showed up in /v3/api-docs as one *required* query parameter "pageable" of type object, so Swagger UI and generated clients asked for an object instead of the optional page / size / sort parameters the endpoint really takes. The Pageable parameter now gets springdoc's @ParameterObject when springdoc is on the processing classpath (no springdoc → no annotation, as before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LcaFXaRgJhB2GBCbwnAc6V
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With
pageable = true, the generatedfindAll(Pageable pageable)was documented in/v3/api-docsas a single required query parameterpageableof type object, instead of the optionalpage/size/sortparameters the endpoint actually takes. The endpoint itself always worked; only the API docs (Swagger UI, generated clients) were wrong.Type
Related issue
None
What was changed
RestControllerGenerator: thePageableparameter gets springdoc's@ParameterObjectwhenorg.springdoc.core.annotations.ParameterObjectis on the processing classpath. Without springdoc nothing changes (no springdoc annotation is generated).RestControllerGeneratorTest: new test for both cases (springdoc present →@ParameterObject Pageable pageable; absent → no annotation).No breaking change — can ship as a 3.0.x patch. (#6 uses the same mechanism for its filter parameter; it will be reconciled when either merges.)
How to test
@ExposeEntity(path = "products", pageable = true)in an app with springdoc.GET /v3/api-docs→/api/productsGET listspage,size,sortas optional query params.Verified end-to-end with this branch published to mavenLocal and a Spring Boot 4.0.8 + springdoc 3.0.3 app:
pageable— required,$ref: Pageable(object)page(integer, default 0),size(integer, default 20),sort(array of string) — all optionalGET ?page=0&size=1&sort=name,descGenerated output (if applicable)
Generated source diff
Checklist
./gradlew :processor:test) — 59/59;./gradlew buildcleanREADME.mdupdated if a public API / annotation attribute changed — n/adocs/tech/updated if architecture or generated artifacts changed — n/atype(scope): descriptionformatGenerated by Claude Code