Skip to content

Commit

Permalink
Merge pull request #85 from ConductionNL/fix/isset-schema-format
Browse files Browse the repository at this point in the history
Check if format is set
  • Loading branch information
bbrands02 authored Dec 3, 2024
2 parents 1fa7269 + 79d37e2 commit f0571f2
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions lib/Db/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,23 @@ public function jsonSerialize(): array
$properties[$key] = $property;
continue;
}
switch ($property['format']) {
case 'string':
// For now array as string
case 'array':
$properties[$key]['default'] = (string) $property;
break;
case 'int':
case 'integer':
case 'number':
$properties[$key]['default'] = (int) $property;
break;
case 'bool':
$properties[$key]['default'] = (bool) $property;
break;

if (isset($property['format']) === true) {
switch ($property['format']) {
case 'string':
// For now array as string
case 'array':
$properties[$key]['default'] = (string) $property;
break;
case 'int':
case 'integer':
case 'number':
$properties[$key]['default'] = (int) $property;
break;
case 'bool':
$properties[$key]['default'] = (bool) $property;
break;
}
}
}
}
Expand Down

0 comments on commit f0571f2

Please sign in to comment.