Skip to content

[BUG][v3.1.0] Impossible to change RequestBody for openapi #5368

@DeLm0re

Description

@DeLm0re

API Platform version(s) affected: 3.1.0

Description
With this new version, it seems impossible to change the request body description or content.

How to reproduce

Define an ApiResource with a Post operation like this

new Metadata\Post(
    routeName: 'api_multiple',
    openapi: new Model\Operation(
        requestBody: new Model\RequestBody(
            content: new \ArrayObject([
                'application/json' => [
                    'schema' => [
                        'type' => 'object',
                        'properties' => [
                            'ids' => [
                                'type' => 'array',
                                'items' => ['type' => 'string'],
                                'example' => ['1e677e04-d461-4389-bedc-6d1b665cc9d6', '01111b43-f53a-4d50-8639-148850e5da19'],
                            ],
                        ],
                    ],
                ],
            ]),
        ),
    ),
),

But on my swagger documentation, the request body is unchanged and it is the default one still

Additional Context
I'm using Symfony 6.2.5, everything work as expected so far

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions