Skip to content

feat(http): Wire Validator and Serializer in http request dispatcher - #63558

Draft
CarlSchwan wants to merge 3 commits into
carl/validatorfrom
carl/serializer-wiring
Draft

feat(http): Wire Validator and Serializer in http request dispatcher#63558
CarlSchwan wants to merge 3 commits into
carl/validatorfrom
carl/serializer-wiring

Conversation

@CarlSchwan

Copy link
Copy Markdown
Member

Summary

Allow to write the following

class PersonController extends Controller {
    public function create(#[RequestPayload] PersonDto $person): DataResponse {
        // $person is already deserialized and valid at this point
    }
}

TODO

  • Openapi generator support (otherwise we can't really use this)

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

This is a very simple wrapper. This expose most interesting features of
the symfony serializer to serialize and deserialize DTO objects. This
can be used in combination with the new Entity system from AppFramework
ORM.

Note that to make full use of this, this still needs to be hooked in the
http dispatcher and http response handling to remove some boilerplate.

Also another next step is doing the same with the symfony validation
component to validate both the ORM entities and the
serialized/deserialized objects.

Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Allow to write the following

class PersonController extends Controller {
    public function create(#[RequestPayload] PersonDto $person): DataResponse {
        // $person is already deserialized and valid at this point
    }
}

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
@CarlSchwan CarlSchwan added this to the Nextcloud 36 milestone Aug 25, 2026
@CarlSchwan CarlSchwan self-assigned this Aug 25, 2026
@CarlSchwan
CarlSchwan requested a review from a team as a code owner August 25, 2026 08:39
@CarlSchwan CarlSchwan added 3. to review Waiting for reviews php Pull requests that update Php code labels Aug 25, 2026
@CarlSchwan
CarlSchwan requested review from icewind1991, provokateurin, salmart-dev and sorbaugh and removed request for a team August 25, 2026 08:39
@CarlSchwan
CarlSchwan marked this pull request as draft August 25, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant