@@ -262,6 +262,18 @@ public function testInvoke(): void
262
262
),
263
263
],
264
264
)),
265
+ 'postDummyItemWithEmptyResponse ' => (new Post ())->withUriTemplate ('/dummyitems/noresponse ' )->withOperation ($ baseOperation )->withOpenapi (new OpenApiOperation (
266
+ responses: [
267
+ '201 ' => new OpenApiResponse (
268
+ description: '' ,
269
+ content: new \ArrayObject (),
270
+ headers: new \ArrayObject (),
271
+ links: new \ArrayObject (),
272
+ ),
273
+ '400 ' => new OpenApiResponse (),
274
+ ],
275
+ requestBody: new RequestBody ('' ),
276
+ )),
265
277
'postDummyItemWithoutInput ' => (new Post ())->withUriTemplate ('/dummyitem/noinput ' )->withOperation ($ baseOperation )->withInput (false ),
266
278
'getDummyCollectionWithErrors ' => (new GetCollection ())->withUriTemplate ('erroredDummies ' )->withErrors ([DummyErrorResource::class])->withOperation ($ baseOperation ),
267
279
])
@@ -1209,6 +1221,40 @@ public function testInvoke(): void
1209
1221
]
1210
1222
), $ dummyItemPath ->getGet ());
1211
1223
1224
+ $ emptyReponsePath = $ paths ->getPath ('/dummyitems/noresponse ' );
1225
+ $ this ->assertEquals (new Operation (
1226
+ 'postDummyItemWithEmptyResponse ' ,
1227
+ ['Dummy ' ],
1228
+ [
1229
+ '201 ' => new Response (
1230
+ '' ,
1231
+ new \ArrayObject (),
1232
+ new \ArrayObject (),
1233
+ new \ArrayObject ()
1234
+ ),
1235
+ '400 ' => new Response (
1236
+ 'Invalid input ' ,
1237
+ content: new \ArrayObject (['application/problem+json ' => new MediaType (schema: new \ArrayObject (['$ref ' => '#/components/schemas/Error ' ]))]),
1238
+ links: new \ArrayObject (['getDummyItem ' => new Model \Link ('getDummyItem ' , new \ArrayObject (['id ' => '$response.body#/id ' ]), null , 'This is a dummy ' )])
1239
+ ),
1240
+ '422 ' => new Response (
1241
+ 'Unprocessable entity ' ,
1242
+ content: new \ArrayObject (['application/problem+json ' => new MediaType (schema: new \ArrayObject (['$ref ' => '#/components/schemas/Error ' ]))]),
1243
+ links: new \ArrayObject (['getDummyItem ' => new Model \Link ('getDummyItem ' , new \ArrayObject (['id ' => '$response.body#/id ' ]), null , 'This is a dummy ' )])
1244
+ ),
1245
+ ],
1246
+ 'Creates a Dummy resource. ' ,
1247
+ 'Creates a Dummy resource. ' ,
1248
+ null ,
1249
+ [],
1250
+ new RequestBody (
1251
+ '' ,
1252
+ content: new \ArrayObject ([
1253
+ 'application/ld+json ' => new MediaType (new \ArrayObject (['$ref ' => '#/components/schemas/Dummy.jsonld ' ])),
1254
+ ]),
1255
+ ),
1256
+ ), $ emptyReponsePath ->getPost ());
1257
+
1212
1258
$ emptyRequestBodyPath = $ paths ->getPath ('/dummyitem/noinput ' );
1213
1259
$ this ->assertEquals (new Operation (
1214
1260
'postDummyItemWithoutInput ' ,
0 commit comments