@@ -175,11 +175,11 @@ public function testInvoke(): void
175
175
'filteredDummyCollection ' => (new GetCollection ())->withUriTemplate ('/filtered ' )->withFilters (['f1 ' , 'f2 ' , 'f3 ' , 'f4 ' , 'f5 ' ])->withOperation ($ baseOperation ),
176
176
// Paginated
177
177
'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 ),
183
183
'postDummyCollectionWithRequestBody ' => (new Post ())->withUriTemplate ('/dummiesRequestBody ' )->withOperation ($ baseOperation )->withOpenapi (new OpenApiOperation (
184
184
requestBody: new RequestBody (
185
185
description: 'List of Ids ' ,
@@ -202,6 +202,11 @@ public function testInvoke(): void
202
202
]),
203
203
),
204
204
)),
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
+ )),
205
210
'putDummyItemWithResponse ' => (new Put ())->withUriTemplate ('/dummyitems/{id} ' )->withOperation ($ baseOperation )->withOpenapi (new OpenApiOperation (
206
211
responses: [
207
212
'200 ' => new OpenApiResponse (
@@ -872,6 +877,36 @@ public function testInvoke(): void
872
877
deprecated: false ,
873
878
), $ requestBodyPath ->getPost ());
874
879
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
+
875
910
$ dummyItemPath = $ paths ->getPath ('/dummyitems/{id} ' );
876
911
$ this ->assertEquals (new Operation (
877
912
'putDummyItemWithResponse ' ,
0 commit comments