@@ -175,11 +175,11 @@ public function testInvoke(): void
175175 'filteredDummyCollection ' => (new GetCollection ())->withUriTemplate ('/filtered ' )->withFilters (['f1 ' , 'f2 ' , 'f3 ' , 'f4 ' , 'f5 ' ])->withOperation ($ baseOperation ),
176176 // Paginated
177177 'paginatedDummyCollection ' => (new GetCollection ())->withUriTemplate ('/paginated ' )
178- ->withPaginationClientEnabled (true )
179- ->withPaginationClientItemsPerPage (true )
180- ->withPaginationItemsPerPage (20 )
181- ->withPaginationMaximumItemsPerPage (80 )
182- ->withOperation ($ baseOperation ),
178+ ->withPaginationClientEnabled (true )
179+ ->withPaginationClientItemsPerPage (true )
180+ ->withPaginationItemsPerPage (20 )
181+ ->withPaginationMaximumItemsPerPage (80 )
182+ ->withOperation ($ baseOperation ),
183183 'postDummyCollectionWithRequestBody ' => (new Post ())->withUriTemplate ('/dummiesRequestBody ' )->withOperation ($ baseOperation )->withOpenapi (new OpenApiOperation (
184184 requestBody: new RequestBody (
185185 description: 'List of Ids ' ,
@@ -202,6 +202,11 @@ public function testInvoke(): void
202202 ]),
203203 ),
204204 )),
205+ 'postDummyCollectionWithRequestBodyWithoutContent ' => (new Post ())->withUriTemplate ('/dummiesRequestBodyWithoutContent ' )->withOperation ($ baseOperation )->withOpenapi (new OpenApiOperation (
206+ requestBody: new RequestBody (
207+ description: 'Extended description for the new Dummy resource ' ,
208+ ),
209+ )),
205210 'putDummyItemWithResponse ' => (new Put ())->withUriTemplate ('/dummyitems/{id} ' )->withOperation ($ baseOperation )->withOpenapi (new OpenApiOperation (
206211 responses: [
207212 '200 ' => new OpenApiResponse (
@@ -872,6 +877,36 @@ public function testInvoke(): void
872877 deprecated: false ,
873878 ), $ requestBodyPath ->getPost ());
874879
880+ $ requestBodyPath = $ paths ->getPath ('/dummiesRequestBodyWithoutContent ' );
881+ $ this ->assertEquals (new Operation (
882+ 'postDummyCollectionWithRequestBodyWithoutContent ' ,
883+ ['Dummy ' ],
884+ [
885+ '201 ' => new Response (
886+ 'Dummy resource created ' ,
887+ new \ArrayObject ([
888+ 'application/ld+json ' => new MediaType (new \ArrayObject (new \ArrayObject (['$ref ' => '#/components/schemas/Dummy.OutputDto ' ]))),
889+ ]),
890+ null ,
891+ new \ArrayObject (['getDummyItem ' => new Model \Link ('getDummyItem ' , new \ArrayObject (['id ' => '$response.body#/id ' ]), null , 'This is a dummy ' )])
892+ ),
893+ '400 ' => new Response ('Invalid input ' ),
894+ '422 ' => new Response ('Unprocessable entity ' ),
895+ ],
896+ 'Creates a Dummy resource. ' ,
897+ 'Creates a Dummy resource. ' ,
898+ null ,
899+ [],
900+ new RequestBody (
901+ 'Extended description for the new Dummy resource ' ,
902+ new \ArrayObject ([
903+ 'application/ld+json ' => new MediaType (new \ArrayObject (new \ArrayObject (['$ref ' => '#/components/schemas/Dummy ' ]))),
904+ ]),
905+ false
906+ ),
907+ deprecated: false ,
908+ ), $ requestBodyPath ->getPost ());
909+
875910 $ dummyItemPath = $ paths ->getPath ('/dummyitems/{id} ' );
876911 $ this ->assertEquals (new Operation (
877912 'putDummyItemWithResponse ' ,
0 commit comments