Commit 5c2c004
committed
meta-schemas: cell: Allow 'default' and 'uniqueItems' for common unit 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]>1 parent e0527d5 commit 5c2c004
File tree
2 files changed
+23
-0
lines changed- dtschema/meta-schemas
- test/schemas
2 files changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments