Skip to content

Commit 54d6593

Browse files
committed
fix for #794
1 parent 3c4b24f commit 54d6593

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

api.include.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9343,7 +9343,8 @@ private function setPaths() /*: void*/
93439343
}
93449344
$this->openapi->set("paths|$path|$method|tags|0", "$type");
93459345
$this->openapi->set("paths|$path|$method|operationId", "$operation" . "_" . "$type");
9346-
if ($operation - $type == 'updateTable') {
9346+
//die(var_dump([$operation,$type]));
9347+
if ("$operation-$type" == 'update-table') {
93479348
$this->openapi->set("paths|$path|$method|description", "rename table");
93489349
} else {
93499350
$this->openapi->set("paths|$path|$method|description", "$operation $type");
@@ -9374,7 +9375,7 @@ private function setComponentSchema() /*: void*/
93749375
switch ($type) {
93759376
case 'database':
93769377
$this->openapi->set("$prefix|properties|tables|type", 'array');
9377-
$this->openapi->set("$prefix|properties|tables|items|\$ref", "#/components/schemas/readTable");
9378+
$this->openapi->set("$prefix|properties|tables|items|\$ref", "#/components/schemas/read-table");
93789379
break;
93799380
case 'table':
93809381
if ($operation == 'update') {
@@ -9386,7 +9387,7 @@ private function setComponentSchema() /*: void*/
93869387
$this->openapi->set("$prefix|properties|type|type", 'string');
93879388
}
93889389
$this->openapi->set("$prefix|properties|columns|type", 'array');
9389-
$this->openapi->set("$prefix|properties|columns|items|\$ref", "#/components/schemas/readColumn");
9390+
$this->openapi->set("$prefix|properties|columns|items|\$ref", "#/components/schemas/read-column");
93909391
}
93919392
break;
93929393
case 'column':

api.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9343,7 +9343,8 @@ private function setPaths() /*: void*/
93439343
}
93449344
$this->openapi->set("paths|$path|$method|tags|0", "$type");
93459345
$this->openapi->set("paths|$path|$method|operationId", "$operation" . "_" . "$type");
9346-
if ($operation - $type == 'updateTable') {
9346+
//die(var_dump([$operation,$type]));
9347+
if ("$operation-$type" == 'update-table') {
93479348
$this->openapi->set("paths|$path|$method|description", "rename table");
93489349
} else {
93499350
$this->openapi->set("paths|$path|$method|description", "$operation $type");
@@ -9374,7 +9375,7 @@ private function setComponentSchema() /*: void*/
93749375
switch ($type) {
93759376
case 'database':
93769377
$this->openapi->set("$prefix|properties|tables|type", 'array');
9377-
$this->openapi->set("$prefix|properties|tables|items|\$ref", "#/components/schemas/readTable");
9378+
$this->openapi->set("$prefix|properties|tables|items|\$ref", "#/components/schemas/read-table");
93789379
break;
93799380
case 'table':
93809381
if ($operation == 'update') {
@@ -9386,7 +9387,7 @@ private function setComponentSchema() /*: void*/
93869387
$this->openapi->set("$prefix|properties|type|type", 'string');
93879388
}
93889389
$this->openapi->set("$prefix|properties|columns|type", 'array');
9389-
$this->openapi->set("$prefix|properties|columns|items|\$ref", "#/components/schemas/readColumn");
9390+
$this->openapi->set("$prefix|properties|columns|items|\$ref", "#/components/schemas/read-column");
93909391
}
93919392
break;
93929393
case 'column':
@@ -11928,6 +11929,7 @@ public static function toString(ResponseInterface $response): string
1192811929
'password' => 'php-crud-api',
1192911930
'database' => 'php-crud-api',
1193011931
// 'debug' => false
11932+
'controllers' => 'records,status,columns,openapi'
1193111933
]);
1193211934
$request = RequestFactory::fromGlobals();
1193311935
$api = new Api($config);

src/Tqdev/PhpCrudApi/OpenApi/OpenApiColumnsBuilder.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ private function setPaths() /*: void*/
7474
}
7575
$this->openapi->set("paths|$path|$method|tags|0", "$type");
7676
$this->openapi->set("paths|$path|$method|operationId", "$operation" . "_" . "$type");
77-
if ($operation - $type == 'updateTable') {
77+
//die(var_dump([$operation,$type]));
78+
if ("$operation-$type" == 'update-table') {
7879
$this->openapi->set("paths|$path|$method|description", "rename table");
7980
} else {
8081
$this->openapi->set("paths|$path|$method|description", "$operation $type");
@@ -105,7 +106,7 @@ private function setComponentSchema() /*: void*/
105106
switch ($type) {
106107
case 'database':
107108
$this->openapi->set("$prefix|properties|tables|type", 'array');
108-
$this->openapi->set("$prefix|properties|tables|items|\$ref", "#/components/schemas/readTable");
109+
$this->openapi->set("$prefix|properties|tables|items|\$ref", "#/components/schemas/read-table");
109110
break;
110111
case 'table':
111112
if ($operation == 'update') {
@@ -117,7 +118,7 @@ private function setComponentSchema() /*: void*/
117118
$this->openapi->set("$prefix|properties|type|type", 'string');
118119
}
119120
$this->openapi->set("$prefix|properties|columns|type", 'array');
120-
$this->openapi->set("$prefix|properties|columns|items|\$ref", "#/components/schemas/readColumn");
121+
$this->openapi->set("$prefix|properties|columns|items|\$ref", "#/components/schemas/read-column");
121122
}
122123
break;
123124
case 'column':

src/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
'password' => 'php-crud-api',
1818
'database' => 'php-crud-api',
1919
// 'debug' => false
20+
'controllers' => 'records,status,columns,openapi'
2021
]);
2122
$request = RequestFactory::fromGlobals();
2223
$api = new Api($config);

0 commit comments

Comments
 (0)