From 13408ab87983c7b2ab0854bcb22bbeb3cff62172 Mon Sep 17 00:00:00 2001 From: Xavier Leune Date: Wed, 8 Jan 2025 12:51:17 +0100 Subject: [PATCH] docs: fix examples for RequestBody (#2415) Hi, this is my first try with this bundle and I got into an error that leads me to a discussion on github. Following the discussion here: https://github.com/nelmio/NelmioApiDocBundle/issues/1990#issuecomment-1126069333 I think that the documentation should be updated to match the "content" argument. But maybe I've missed something else ? Thanks ! ## What type of PR is this? (check all applicable) - [ ] Bug Fix - [ ] Feature - [ ] Refactor - [ ] Deprecation - [ ] Breaking Change - [x] Documentation Update - [ ] CI ## Checklist - [x] I have made corresponding changes to the documentation (`docs/`) - [ ] I have made corresponding changes to the changelog (`CHANGELOG.md`) Co-authored-by: Djordy Koert --- docs/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 76203f2a4..deb90afc9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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::