Skip to content

Commit

Permalink
Fix examples for RequestBody
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierleune committed Jan 6, 2025
1 parent 8e56941 commit 2212233
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@ that property type to not be nullable, for example.
/**
* Similarly, this will make the username `required` in the create
* schema
* @OA\RequestBody(@Model(type=UserDto::class, groups={"create"}))
* @OA\RequestBody(content: @Model(type=UserDto::class, groups={"create"}))
*/
/**
* But for updates, the `username` property will not be required
* @OA\RequestBody(@Model(type=UserDto::class, groups={"update"}))
* @OA\RequestBody(content: @Model(type=UserDto::class, groups={"update"}))
*/
.. code-block:: php-attributes
Expand All @@ -389,10 +389,10 @@ that property type to not be nullable, for example.
#[OA\Response(response: 200, content: new Model(type: UserDto::class, groups: ["default"]))]
// Similarly, this will make the username `required` in the create schema
#[OA\RequestBody(new Model(type: UserDto::class, groups: ["create"]))]
#[OA\RequestBody(content: new Model(type: UserDto::class, groups: ["create"]))]
// But for updates, the `username` property will not be required
#[OA\RequestBody(new Model(type: UserDto::class, groups: ["update"]))]
#[OA\RequestBody(content: new Model(type: UserDto::class, groups: ["update"]))]
.. tip::
Expand Down

0 comments on commit 2212233

Please sign in to comment.