Skip to content

Commit 1e7b510

Browse files
committed
bugfix
1 parent 082d5e4 commit 1e7b510

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ public function __construct() {
939939
k1."table" = ? AND
940940
k2."table" IN ?',
941941
'reflect_columns'=> 'SELECT
942-
"name", "dflt_value", "notnull", "type", 2147483647
942+
"name", "dflt_value", case when "notnull"==1 then \'NO\' else \'YES\' end as "nullable", "type", 2147483647
943943
FROM
944944
"sys/columns"
945945
WHERE
@@ -2263,7 +2263,7 @@ protected function swagger($settings) {
22632263
$result = $this->db->query($this->db->getSql('reflect_columns'),array($table_list[0],$database));
22642264
while ($row = $this->db->fetchRow($result)) {
22652265
if ($row[1]!==null) $table_fields[$table['name']][$row[0]]->default = $row[1];
2266-
$table_fields[$table['name']][$row[0]]->required = in_array(strtolower($row[2]),array('no','1')) && $row[1]===null;
2266+
$table_fields[$table['name']][$row[0]]->required = strtolower($row[2])=='no' && $row[1]===null;
22672267
$table_fields[$table['name']][$row[0]]->{'x-dbtype'} = $row[3];
22682268
$table_fields[$table['name']][$row[0]]->maxLength = $row[4];
22692269
if ($this->db->isNumericType($table_fields[$table['name']][$row[0]])) {

0 commit comments

Comments
 (0)