@@ -471,7 +471,7 @@ public function isGeometryType($field) {
471
471
}
472
472
473
473
public function isJsonType ($ field ) {
474
- return $ field ->type == ' jsonb ' ;
474
+ return in_array ( $ field ->type , array ( ' json ' , ' jsonb ')) ;
475
475
}
476
476
477
477
public function getDefaultCharset () {
@@ -1059,11 +1059,11 @@ public function isBinaryType($field) {
1059
1059
}
1060
1060
1061
1061
public function isGeometryType ($ field ) {
1062
- return in_array ($ field ->type ,array ('geometry ' ));;
1062
+ return in_array ($ field ->type ,array ('geometry ' ));
1063
1063
}
1064
1064
1065
1065
public function isJsonType ($ field ) {
1066
- return in_array ($ field ->type ,array ('json ' ,'jsonb ' ));;
1066
+ return in_array ($ field ->type ,array ('json ' ,'jsonb ' ));
1067
1067
}
1068
1068
1069
1069
public function getDefaultCharset () {
@@ -2249,7 +2249,6 @@ protected function swagger($settings) {
2249
2249
$ table_fields [$ table ['name ' ]][$ row [0 ]]->required = strtolower ($ row [2 ])=='no ' && $ row [1 ]===null ;
2250
2250
$ table_fields [$ table ['name ' ]][$ row [0 ]]->{'x-nullable ' } = strtolower ($ row [2 ])=='yes ' ;
2251
2251
$ table_fields [$ table ['name ' ]][$ row [0 ]]->{'x-dbtype ' } = $ row [3 ];
2252
- $ table_fields [$ table ['name ' ]][$ row [0 ]]->maxLength = $ row [4 ];
2253
2252
if ($ this ->db ->isNumericType ($ table_fields [$ table ['name ' ]][$ row [0 ]])) {
2254
2253
if (strpos (strtolower ($ table_fields [$ table ['name ' ]][$ row [0 ]]->{'x-dbtype ' }),'int ' )!==false ) {
2255
2254
$ table_fields [$ table ['name ' ]][$ row [0 ]]->type = 'integer ' ;
@@ -2258,7 +2257,6 @@ protected function swagger($settings) {
2258
2257
$ table_fields [$ table ['name ' ]][$ row [0 ]]->type = 'number ' ;
2259
2258
if ($ row [1 ]!==null ) $ table_fields [$ table ['name ' ]][$ row [0 ]]->default = (float )$ row [1 ];
2260
2259
}
2261
-
2262
2260
} else {
2263
2261
if ($ this ->db ->isBinaryType ($ table_fields [$ table ['name ' ]][$ row [0 ]])) {
2264
2262
$ table_fields [$ table ['name ' ]][$ row [0 ]]->format = 'byte ' ;
@@ -2269,6 +2267,7 @@ protected function swagger($settings) {
2269
2267
}
2270
2268
$ table_fields [$ table ['name ' ]][$ row [0 ]]->type = 'string ' ;
2271
2269
if ($ row [1 ]!==null ) $ table_fields [$ table ['name ' ]][$ row [0 ]]->default = $ row [1 ];
2270
+ if ($ row [4 ]!==null ) $ table_fields [$ table ['name ' ]][$ row [0 ]]->maxLength = (int )$ row [4 ];
2272
2271
}
2273
2272
}
2274
2273
0 commit comments