Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Fixed array processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Reggino committed Jul 10, 2014
1 parent d46a08c commit 609049f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/JsonSchemaForm/DataParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ public function parse($formData, $schema) {
case 'boolean':
$parsedValue = (boolean) $value;
break;

case 'number':
$parsedValue = (int) $value;
break;

case 'array':
$parsedValue = array();
foreach ($value as $item) {
$parsedValue[] = DataParser::parse($item, $schemaNode->items);
}
break;

default:
echo 'Datatype not supported by DataParser: ' . $schemaNode->type . PHP_EOL;
print_r($value);
print_r($schemaNode);
exit;
}
Expand Down

0 comments on commit 609049f

Please sign in to comment.