mattiabasone commented on code in PR #3528:
URL: https://github.com/apache/avro/pull/3528#discussion_r2494189859
##########
lang/php/lib/Schema/AvroSchema.php:
##########
@@ -379,81 +380,80 @@ public static function realParse($avro,
$default_namespace = null, &$schemata =
$new_name = new AvroName($name, $namespace,
$default_namespace);
$doc = $avro[self::DOC_ATTR] ?? null;
$aliases = $avro[self::ALIASES_ATTR] ?? null;
+ AvroNamedSchema::hasValidAliases($aliases);
switch ($type) {
case self::FIXED_SCHEMA:
- $size = $avro[self::SIZE_ATTR] ?? null;
+ $size = $avro[self::SIZE_ATTR] ?? throw new
AvroSchemaParseException(
+ "Size is required for fixed schema"
+ );
+ $size = (int) $size;
+
if (array_key_exists(self::LOGICAL_TYPE_ATTR, $avro)) {
switch ($avro[self::LOGICAL_TYPE_ATTR]) {
case self::DURATION_LOGICAL_TYPE:
return AvroFixedSchema::duration(
- $new_name,
- $doc,
Review Comment:
https://github.com/apache/avro/pull/3528/commits/74b1d4456e2a0603a6f2d995a72774748f0d5cbd
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]