Skip to content

Commit 18b2942

Browse files
committed
Fix for #193, thank you jr3cermak
1 parent 16a2abe commit 18b2942

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

api.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,9 +2443,15 @@ protected function swagger($settings) {
24432443
echo '"name":"item",';
24442444
echo '"in":"body",';
24452445
echo '"description":"Item to create.",';
2446-
echo '"required":false,';
2446+
echo '"required":true,';
24472447
echo '"schema":{';
24482448
echo '"type": "object",';
2449+
echo '"required":[';
2450+
foreach (array_keys($action['fields']) as $k=>$field) {
2451+
if ($k>0) echo ',';
2452+
echo json_encode($field);
2453+
}
2454+
echo '],'; //required
24492455
echo '"properties": {';
24502456
foreach (array_keys($action['fields']) as $k=>$field) {
24512457
if ($k>0) echo ',';
@@ -2510,9 +2516,15 @@ protected function swagger($settings) {
25102516
echo '"name":"item",';
25112517
echo '"in":"body",';
25122518
echo '"description":"Properties of item to update.",';
2513-
echo '"required":false,';
2519+
echo '"required":true,';
25142520
echo '"schema":{';
25152521
echo '"type": "object",';
2522+
echo '"required":[';
2523+
foreach (array_keys($action['fields']) as $k=>$field) {
2524+
if ($k>0) echo ',';
2525+
echo json_encode($field);
2526+
}
2527+
echo '],'; //required
25162528
echo '"properties": {';
25172529
foreach (array_keys($action['fields']) as $k=>$field) {
25182530
if ($k>0) echo ',';

0 commit comments

Comments
 (0)