Skip to content

[Bug]: MapRequestPayload doesn't handle type with scalar values #2462

@Arkounay

Description

@Arkounay

Version

5.0.0

Description

Hi,

When using MapRequestPayload with a scalar type value, for example "int"

#[Route('/route', methods: ['PATCH'])]
public function patchRoute(#[MapRequestPayload(type: 'int')] array $ids): Response
{
// ...
}

it triggers the following exception:

Schema of type "\int" can't be generated, no describer supports it. Class "\int" does not exist, did you forget a use statement, or typed it wrong?  

in src/Model/ModelRegistry.php (line 131)

JSON OpenApi

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions