From e0b70cde27cbb8c312663acf1392beaeaab9811e Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 20 Nov 2023 10:03:25 -0700 Subject: [PATCH] fixups: Apply int array to matrix fixup even for 1 item There was a corner case where an array with 1 item was defined: $ref: /schemas/types.yaml#/definitions/uint32-array maxItems: 1 While that's not really valid because 1 item is just an uint32, not an array, the schema didn't work correctly either. With the fixup skipped, maxItems applied to the outer array (which is always 1 item for arrays) when the intent was for the inner array. Since support of 2 forms of array encoding has been dropped, we can also just drop the maxItems check. Signed-off-by: Rob Herring --- dtschema/fixups.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/dtschema/fixups.py b/dtschema/fixups.py index b6ce766..d7b99de 100644 --- a/dtschema/fixups.py +++ b/dtschema/fixups.py @@ -125,9 +125,6 @@ def _fixup_int_array_min_max_to_matrix(subschema, path=[]): if _is_matrix_schema(subschema): return - if subschema.get('maxItems') == 1: - return - tmpsch = {} if 'minItems' in subschema: tmpsch['minItems'] = subschema.pop('minItems')