core icon indicating copy to clipboard operation
core copied to clipboard

feat(openapi): allow optional request body content

Open monitaurus opened this issue 1 year ago • 0 comments

Q A
Branch? main
Tickets Closes #2680
License MIT
Doc PR already existing (see doc)

Allow to generate a default request content or description if not defined in the extension of OpenApi using Model\RequestBody.

For example, on a POST /greetings/test operation on a Greeting entity with a id and a name, the following:

#[ApiResource(
    mercure: true,
    operations: [
        new Post(
            uriTemplate: '/greetings/test',
            openapi: new Operation(
                requestBody: new RequestBody(
                    description: 'Extended description',
                ),
            ),
        ),
    ],
)]

Will generate the following OpenApi, with the default generated content: image

monitaurus avatar May 18 '24 21:05 monitaurus