@@ -290,17 +290,17 @@ public function getMethods($service)
290
290
continue ;
291
291
}
292
292
293
- if (empty ($ method ['x-appwrite ' ]['multiplex ' ] ?? [])) {
293
+ if (empty ($ method ['x-appwrite ' ]['additional-methods ' ] ?? [])) {
294
294
$ list [] = $ this ->parseMethod ($ methodName , $ pathName , $ method );
295
295
continue ;
296
296
}
297
297
298
- foreach ($ method ['x-appwrite ' ]['multiplex ' ] as $ multiplex ) {
299
- $ multiplexMethod = $ method ;
300
- $ multiplexMethod ['x-appwrite ' ]['method ' ] = $ multiplex ['name ' ];
298
+ foreach ($ method ['x-appwrite ' ]['additional-methods ' ] as $ additionalMethod ) {
299
+ $ duplicatedMethod = $ method ;
300
+ $ duplicatedMethod ['x-appwrite ' ]['method ' ] = $ additionalMethod ['name ' ];
301
301
302
302
// Update Response
303
- $ responses = $ multiplexMethod ['responses ' ];
303
+ $ responses = $ duplicatedMethod ['responses ' ];
304
304
$ convertedResponse = [];
305
305
306
306
foreach ($ responses as $ code => $ desc ) {
@@ -309,7 +309,7 @@ public function getMethods($service)
309
309
}
310
310
311
311
foreach ($ desc ['schema ' ]['x-oneOf ' ] as $ oneOf ) {
312
- if (!isset ($ oneOf ['$ref ' ]) || !str_ends_with ($ oneOf ['$ref ' ], $ multiplex ['response ' ])) {
312
+ if (!isset ($ oneOf ['$ref ' ]) || !str_ends_with ($ oneOf ['$ref ' ], $ additionalMethod ['response ' ])) {
313
313
continue ;
314
314
}
315
315
@@ -320,44 +320,44 @@ public function getMethods($service)
320
320
}
321
321
}
322
322
323
- $ multiplexMethod ['responses ' ] = $ convertedResponse ;
323
+ $ duplicatedMethod ['responses ' ] = $ convertedResponse ;
324
324
325
325
// Remove non-whitelisted parameters on body parameters, also set required.
326
- $ handleParams = function (&$ params ) use ($ multiplex ) {
327
- if (isset ($ multiplex ['parameters ' ])) {
326
+ $ handleParams = function (&$ params ) use ($ additionalMethod ) {
327
+ if (isset ($ additionalMethod ['parameters ' ])) {
328
328
foreach ($ params as $ key => $ param ) {
329
329
if (empty ($ param ['in ' ]) || $ param ['in ' ] !== 'body ' || empty ($ param ['schema ' ]['properties ' ])) {
330
330
continue ;
331
331
}
332
332
333
- $ whitelistedParams = $ multiplex ['parameters ' ] ?? [];
333
+ $ whitelistedParams = $ additionalMethod ['parameters ' ] ?? [];
334
334
335
335
foreach ($ param ['schema ' ]['properties ' ] as $ paramName => $ value ) {
336
336
if (!in_array ($ paramName , $ whitelistedParams )) {
337
337
unset($ param ['schema ' ]['properties ' ][$ paramName ]);
338
338
}
339
339
}
340
340
341
- $ param ['schema ' ]['required ' ] = $ multiplex ['required ' ] ?? [];
341
+ $ param ['schema ' ]['required ' ] = $ additionalMethod ['required ' ] ?? [];
342
342
$ params [$ key ] = $ param ;
343
343
}
344
344
}
345
345
346
346
return ;
347
347
};
348
348
349
- $ handleParams ($ multiplexMethod ['parameters ' ]);
349
+ $ handleParams ($ duplicatedMethod ['parameters ' ]);
350
350
351
351
// Overwrite description and name if multiplex has one
352
- if (!empty ($ multiplex ['name ' ])) {
353
- $ multiplexMethod ['summary ' ] = $ multiplex ['name ' ];
352
+ if (!empty ($ additionalMethod ['name ' ])) {
353
+ $ duplicatedMethod ['summary ' ] = $ additionalMethod ['name ' ];
354
354
}
355
355
356
- if (!empty ($ multiplex ['description ' ])) {
357
- $ multiplexMethod ['description ' ] = $ multiplex ['description ' ];
356
+ if (!empty ($ additionalMethod ['description ' ])) {
357
+ $ duplicatedMethod ['description ' ] = $ additionalMethod ['description ' ];
358
358
}
359
359
360
- $ list [] = $ this ->parseMethod ($ methodName , $ pathName , $ multiplexMethod );
360
+ $ list [] = $ this ->parseMethod ($ methodName , $ pathName , $ duplicatedMethod );
361
361
}
362
362
}
363
363
}
0 commit comments