Skip to content

Updated documentation to describe when validators run - #2594

Open
ruthst00 wants to merge 1 commit into
spring-projects:mainfrom
ruthst00:DATAREST-789-ruthes00
Open

Updated documentation to describe when validators run#2594
ruthst00 wants to merge 1 commit into
spring-projects:mainfrom
ruthst00:DATAREST-789-ruthes00

Conversation

@ruthst00

@ruthst00 ruthst00 commented Sep 6, 2026

Copy link
Copy Markdown

Fixes #1161

Solution

The documentation has been updated in two files to resolve GitHub issue DATAREST-789 (#1161):

src/main/antora/modules/ROOT/pages/events.adoc — Added a new "Event Lifecycle and Object State" section that:

  • Documents step-by-step when each event fires for POST, PUT, PATCH, DELETE, and association resource operations
  • Explicitly calls out the critical PATCH behavior: BeforeSaveEvent receives the already-merged domain object (existing entity + patch applied), not the raw partial input
  • Includes a summary reference table mapping each event to its triggering HTTP method and the object state passed to the handler
  • Adds an inline comment in the annotated handler code example clarifying the PATCH object state

src/main/antora/modules/ROOT/pages/validation.adoc — Added a new "Validation Events and Object State" section that:

  • Provides a reference table mapping each event prefix (e.g., beforeSave, beforeCreate) to its HTTP trigger and the object state the validator receives
  • Adds a dedicated "Validation and PATCH Requests" subsection explicitly explaining that beforeSave validators receive the fully-merged entity for PATCH (not a partial object), with a concrete code example showing it is safe to validate all fields
  • Expands the bean name wiring section with explicit examples for both beforeCreate and beforeSave validators
  • Adds a cross-reference to the Events page for the full lifecycle details

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

…GitHub issue DATAREST-789

Signed-off-by: ruthes00 <ruthes00@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 6, 2026
@ruthst00 ruthst00 changed the title DATAREST-789-ruthes00. updated documentation in two files to resolve GitHub issue DATAREST-789 Updated documentation in two files to resolve GitHub issue DATAREST-789 Sep 13, 2026
@ruthst00 ruthst00 changed the title Updated documentation in two files to resolve GitHub issue DATAREST-789 Updated documentation to describe when validators run Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validator docs are silent on when validators run and implications to developers [DATAREST-789]

2 participants