File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,21 +37,24 @@ private function removeApplicationJsonFromFormDataOperations(array $paths): arra
3737 if (
3838 empty ($ operation ['requestBody ' ])
3939 || empty ($ operation ['requestBody ' ]['content ' ])
40+ || empty ($ operation ['requestBody ' ]['content ' ]['multipart/form-data ' ])
4041 ) {
4142 continue ;
4243 }
4344
4445 $ content = $ operation ['requestBody ' ]['content ' ];
46+ $ json_examples = [];
4547
46- if (empty ($ content ['multipart/form-data ' ])) {
47- continue ;
48+ if (! empty ($ content ['application/json ' ][ ' examples ' ])) {
49+ $ json_examples = $ content [ ' application/json ' ][ ' examples ' ] ;
4850 }
4951
50- $ json_examples = $ content ['application/json ' ]['examples ' ] ?? [];
5152 unset($ content ['application/json ' ]);
52- $ content ['multipart/form-data ' ]['examples ' ] = $ json_examples ;
5353
54- $ operation ['requestBody ' ]['content ' ] = $ content ;
54+ if (empty ($ content ['multipart/form-data ' ]['examples ' ])) {
55+ $ content ['multipart/form-data ' ]['examples ' ] = $ json_examples ;
56+ }
57+
5558 $ paths [$ path ][$ method ]['requestBody ' ]['content ' ] = $ content ;
5659 }
5760 }
You can’t perform that action at this time.
0 commit comments