Support interface projections for annotated controller return values - #1518
Open
goutamadwant wants to merge 1 commit into
Open
Support interface projections for annotated controller return values#1518goutamadwant wants to merge 1 commit into
goutamadwant wants to merge 1 commit into
Conversation
Add ProjectAs for annotated controller return values, reusing Spring Data interface projections and preserving collection and asynchronous shapes. Include schema inspection metadata and nested projection AOT hints. Closes spring-projects#657. Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
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.
Annotated controllers currently require manual projection creation to expose a view of a domain object. Add @ProjectAS to select a Spring Data interface projection for a @schemamapping method, including query, mutation, and subscription mappings.
Apply projections to returned values and collection or asynchronous elements while preserving nulls, errors, and DataFetcherResult metadata. Include projected return-type information for schema inspection, nested projection proxy hints for AOT, and reference documentation. Spring Data Commons remains optional for controllers without the annotation.
Tests cover synchronous and asynchronous results, subscriptions, coroutine controllers, exception handling, projected child sources, invalid targets, and inherited/composed AOT projections.
Validation: the final controller, coroutine, and AOT suites pass (65 tests), together with fresh style and architecture checks. Broader default and Java 21 suites, run before the final two metadata corrections, had the same 10 existing MVC/WebFlux SSE whitespace assertion failures reproduced on unmodified main, plus 3 pre-existing skips.
Closes #657.