@@ -9064,16 +9064,16 @@ class OpenApiRecordsBuilder
9064
9064
'integer ' => ['type ' => 'integer ' , 'format ' => 'int32 ' ],
9065
9065
'bigint ' => ['type ' => 'integer ' , 'format ' => 'int64 ' ],
9066
9066
'varchar ' => ['type ' => 'string ' ],
9067
- 'clob ' => ['type ' => 'string ' ],
9067
+ 'clob ' => ['type ' => 'string ' , ' format ' => ' large-string ' ], //custom format
9068
9068
'varbinary ' => ['type ' => 'string ' , 'format ' => 'byte ' ],
9069
- 'blob ' => ['type ' => 'string ' , 'format ' => 'byte ' ],
9070
- 'decimal ' => ['type ' => 'string ' ],
9069
+ 'blob ' => ['type ' => 'string ' , 'format ' => 'large- byte ' ], //custom format
9070
+ 'decimal ' => ['type ' => 'string ' , ' format ' => ' decimal ' ], //custom format
9071
9071
'float ' => ['type ' => 'number ' , 'format ' => 'float ' ],
9072
9072
'double ' => ['type ' => 'number ' , 'format ' => 'double ' ],
9073
9073
'date ' => ['type ' => 'string ' , 'format ' => 'date ' ],
9074
- 'time ' => ['type ' => 'string ' , 'format ' => 'date- time ' ],
9074
+ 'time ' => ['type ' => 'string ' , 'format ' => 'time ' ], //custom format
9075
9075
'timestamp ' => ['type ' => 'string ' , 'format ' => 'date-time ' ],
9076
- 'geometry ' => ['type ' => 'string ' ],
9076
+ 'geometry ' => ['type ' => 'string ' , ' format ' => ' geometry ' ], //custom format
9077
9077
'boolean ' => ['type ' => 'boolean ' ],
9078
9078
];
9079
9079
@@ -9245,8 +9245,12 @@ private function setComponentSchema(string $tableName, array $references) /*: vo
9245
9245
}
9246
9246
$ column = $ table ->getColumn ($ columnName );
9247
9247
$ properties = $ this ->types [$ column ->getType ()];
9248
+ $ properties ['maxLength ' ] = $ column ->hasLength () ? $ column ->getLength () : 0 ;
9249
+ $ properties ['nullable ' ] = $ column ->getNullable ();
9248
9250
foreach ($ properties as $ key => $ value ) {
9249
- $ this ->openapi ->set ("$ prefix|properties| $ columnName| $ key " , $ value );
9251
+ if ($ value ) {
9252
+ $ this ->openapi ->set ("$ prefix|properties| $ columnName| $ key " , $ value );
9253
+ }
9250
9254
}
9251
9255
if ($ column ->getPk ()) {
9252
9256
$ this ->openapi ->set ("$ prefix|properties| $ columnName|x-primary-key " , true );
0 commit comments