Skip to content

Conversation

@krzk
Copy link

@krzk krzk commented Nov 10, 2025

… arrays

Properties with common unit suffixes are type of 'cell.yaml#/array' which lists allowed property names. 'default' and 'uniqueItems' are not there, thus property like:

fiti,tdly-ms:
description: example
maxItems: 4
items:
enum: [0, 1, 2, 4]
default: [0, 0, 0, 0]

was failing with:

properties:fiti,tdly-ms: 'anyOf' conditional failed, one must be fixed:
'items' is not one of ['maxItems', 'description', 'deprecated']
hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
'default' is not one of ['maxItems', 'description', 'deprecated']
hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
Additional properties are not allowed ('default' was unexpected)
hint: Arrays must be described with a combination of minItems/maxItems/items
'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
[0, 0, 0, 0] is not of type 'integer'
1 was expected
hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
from schema $id: http://devicetree.org/meta-schemas/cell.yaml

Add a simple test-case for that which can be used with:

dt-doc-validate -u test/schemas test/schemas/property-units-example.yaml

yamllint complains:
  error    no new line character at the end of file  (new-line-at-end-of-file)

Signed-off-by: Krzysztof Kozlowski <[email protected]>
… arrays

Properties with common unit suffixes are type of 'cell.yaml#/array'
which lists allowed property names.  'default' and 'uniqueItems' are not
there, thus property like:

  fiti,tdly-ms:
    description: example
    maxItems: 4
    items:
      enum: [0, 1, 2, 4]
    default: [0, 0, 0, 0]

was failing with:

  properties:fiti,tdly-ms: 'anyOf' conditional failed, one must be fixed:
    'items' is not one of ['maxItems', 'description', 'deprecated']
      hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
    'default' is not one of ['maxItems', 'description', 'deprecated']
      hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
    Additional properties are not allowed ('default' was unexpected)
      hint: Arrays must be described with a combination of minItems/maxItems/items
    'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
    'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
    [0, 0, 0, 0] is not of type 'integer'
    1 was expected
      hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
    hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
    from schema $id: http://devicetree.org/meta-schemas/cell.yaml

Add a simple test-case for that which can be used with:

  dt-doc-validate -u test/schemas test/schemas/property-units-example.yaml

Signed-off-by: Krzysztof Kozlowski <[email protected]>
@robherring robherring merged commit 4df8278 into devicetree-org:main Nov 10, 2025
7 checks passed
@krzk krzk deleted the cell-fix branch November 10, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants