core
core copied to clipboard
feat(openapi): allow optional request body content
| 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: