3
3
namespace Tqdev \PhpCrudApi \OpenApi ;
4
4
5
5
use Tqdev \PhpCrudApi \Column \ReflectionService ;
6
+ use Tqdev \PhpCrudApi \Column \Reflection \ReflectedColumn ;
6
7
use Tqdev \PhpCrudApi \Middleware \Communication \VariableStore ;
7
8
use Tqdev \PhpCrudApi \OpenApi \OpenApiDefinition ;
8
- use Tqdev \PhpCrudApi \Column \Reflection \ReflectedColumn ;
9
9
10
10
class OpenApiRecordsBuilder
11
11
{
@@ -23,16 +23,16 @@ class OpenApiRecordsBuilder
23
23
'integer ' => ['type ' => 'integer ' , 'format ' => 'int32 ' ],
24
24
'bigint ' => ['type ' => 'integer ' , 'format ' => 'int64 ' ],
25
25
'varchar ' => ['type ' => 'string ' ],
26
- 'clob ' => ['type ' => 'string ' , 'format ' => 'large-string ' ], //custom format
26
+ 'clob ' => ['type ' => 'string ' , 'format ' => 'large-string ' ], //custom format
27
27
'varbinary ' => ['type ' => 'string ' , 'format ' => 'byte ' ],
28
- 'blob ' => ['type ' => 'string ' , 'format ' => 'large-byte ' ], //custom format
29
- 'decimal ' => ['type ' => 'string ' , 'format ' => 'decimal ' ], //custom format
28
+ 'blob ' => ['type ' => 'string ' , 'format ' => 'large-byte ' ], //custom format
29
+ 'decimal ' => ['type ' => 'string ' , 'format ' => 'decimal ' ], //custom format
30
30
'float ' => ['type ' => 'number ' , 'format ' => 'float ' ],
31
31
'double ' => ['type ' => 'number ' , 'format ' => 'double ' ],
32
32
'date ' => ['type ' => 'string ' , 'format ' => 'date ' ],
33
- 'time ' => ['type ' => 'string ' , 'format ' => 'time ' ], //custom format
33
+ 'time ' => ['type ' => 'string ' , 'format ' => 'time ' ], //custom format
34
34
'timestamp ' => ['type ' => 'string ' , 'format ' => 'date-time ' ],
35
- 'geometry ' => ['type ' => 'string ' , 'format ' => 'geometry ' ], //custom format
35
+ 'geometry ' => ['type ' => 'string ' , 'format ' => 'geometry ' ], //custom format
36
36
'boolean ' => ['type ' => 'boolean ' ],
37
37
];
38
38
@@ -222,7 +222,10 @@ private function setComponentSchema(string $tableName, array $references) /*: vo
222
222
if (!$ pkName && $ operation != 'list ' ) {
223
223
continue ;
224
224
}
225
- if ($ type != 'table ' && $ operation != 'list ' ) {
225
+ if ($ type == 'view ' && !in_array ($ operation , array ('read ' , 'list ' ))) {
226
+ continue ;
227
+ }
228
+ if ($ type == 'view ' && !$ pkName && $ operation == 'read ' ) {
226
229
continue ;
227
230
}
228
231
if ($ operation == 'delete ' ) {
0 commit comments