Skip to content

[MapRequestPayload] Fail because property documentation #58742

Answered by vltrof
GErpeldinger asked this question in Q&A
Discussion options

You must be logged in to vote

Greetings!
It seems like when normalizer parse DTO name overlapping occurs and produce this undefined behavior
You have constructor param and property with same name but different types and normalizer look at property type definition then constructor param
If change the property name everything works fine
for example

<?php

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Component\Routing\Attribute\Route;

#[Route('bug')]
class BugController extends AbstractController
{
    public function __invoke(
        #[MapRequestPa…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by GErpeldinger
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #58719 on November 03, 2024 22:31.