Skip to content

Commit

Permalink
fixups: Fix dropping of array 'items' schema
Browse files Browse the repository at this point in the history
In the case of a schema having the schema form of 'items',
_fixup_int_array_min_max_to_matrix() is just dropping 'items' schema.
That also then causes 'minItems' or 'maxItems' to get added which we
normally only do if 'items' is a list.

Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
robherring committed Mar 12, 2024
1 parent c95c9ad commit 5fdf965
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dtschema/fixups.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def _fixup_int_array_min_max_to_matrix(subschema, path=[]):
tmpsch['minItems'] = subschema.pop('minItems')
if 'maxItems' in subschema:
tmpsch['maxItems'] = subschema.pop('maxItems')
if 'items' in subschema:
tmpsch['items'] = subschema.pop('items')

if tmpsch:
subschema['items'] = tmpsch
Expand Down

0 comments on commit 5fdf965

Please sign in to comment.