Skip to content

Mark Spring Data PagedModel properties as required - #3360

Open
dpkass wants to merge 1 commit into
springdoc:mainfrom
dpkass:codex/require-paged-model-properties
Open

dpkass wants to merge 1 commit into
springdoc:mainfrom
dpkass:codex/require-paged-model-properties

Conversation

@dpkass

@dpkass dpkass commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Spring Data recommends PagedModel as the stable JSON representation for Page responses, but its generated schema currently makes content, page, and every page metadata field optional. This causes client generators to weaken fields that the runtime representation always emits.

Teach PageOpenAPIConverter to mark the PagedModel and PageMetadata properties as required for both explicitly returned models and Page responses converted through VIA_DTO.

Spring Data's PagedModel is the preferred stable JSON representation for Page responses. Reflect its guaranteed content, page, and page metadata properties in generated OpenAPI schemas.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
@dpkass
dpkass force-pushed the codex/require-paged-model-properties branch from 4fc502f to a7c3e3c Compare September 15, 2026 14:26
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.

1 participant