| 1 |
# SPDX-License-Identifier: BSD-2-Clause |
| 2 |
# Copyright 2019-2021 Arm Ltd. |
| 3 |
%YAML 1.2 |
| 4 |
--- |
| 5 |
$id: http://devicetree.org/meta-schemas/items.yaml# |
| 6 |
$schema: https://json-schema.org/draft/2019-09/schema |
| 7 |
|
| 8 |
description: |
| 9 |
Meta-schema for 'items' schema. This meta-schema checks that an 'items' list |
| 10 |
doesn't have 'minItems' and 'maxItems' with the same value as the length of |
| 11 |
the list. |
| 12 |
|
| 13 |
properties: |
| 14 |
allOf: |
| 15 |
items: |
| 16 |
$ref: '#' |
| 17 |
anyOf: |
| 18 |
items: |
| 19 |
$ref: '#' |
| 20 |
oneOf: |
| 21 |
items: |
| 22 |
$ref: '#' |
| 23 |
then: |
| 24 |
$ref: '#' |
| 25 |
|
| 26 |
allOf: |
| 27 |
- if: |
| 28 |
type: object |
| 29 |
properties: |
| 30 |
items: |
| 31 |
type: array |
| 32 |
additionalItems: false |
| 33 |
required: |
| 34 |
- items |
| 35 |
- maxItems |
| 36 |
then: |
| 37 |
description: '"maxItems" is not needed with an "items" list' |
| 38 |
not: |
| 39 |
required: |
| 40 |
- maxItems |
| 41 |
- if: |
| 42 |
type: object |
| 43 |
properties: |
| 44 |
items: |
| 45 |
type: array |
| 46 |
additionalItems: false |
| 47 |
required: |
| 48 |
- items |
| 49 |
- minItems |
| 50 |
then: |
| 51 |
description: |
| 52 |
'"minItems" is only needed if less than the "items" list length' |
| 53 |
oneOf: |
| 54 |
- properties: |
| 55 |
items: |
| 56 |
minItems: 1 |
| 57 |
maxItems: 1 |
| 58 |
minItems: false |
| 59 |
- properties: |
| 60 |
items: |
| 61 |
minItems: 2 |
| 62 |
maxItems: 2 |
| 63 |
minItems: |
| 64 |
const: 1 |
| 65 |
- properties: |
| 66 |
items: |
| 67 |
minItems: 3 |
| 68 |
maxItems: 3 |
| 69 |
minItems: |
| 70 |
maximum: 2 |
| 71 |
- properties: |
| 72 |
items: |
| 73 |
minItems: 4 |
| 74 |
maxItems: 4 |
| 75 |
minItems: |
| 76 |
maximum: 3 |
| 77 |
- properties: |
| 78 |
items: |
| 79 |
minItems: 5 |
| 80 |
maxItems: 5 |
| 81 |
minItems: |
| 82 |
maximum: 4 |
| 83 |
- properties: |
| 84 |
items: |
| 85 |
minItems: 6 |
| 86 |
maxItems: 6 |
| 87 |
minItems: |
| 88 |
maximum: 5 |
| 89 |
- properties: |
| 90 |
items: |
| 91 |
minItems: 7 |
| 92 |
maxItems: 7 |
| 93 |
minItems: |
| 94 |
maximum: 6 |
| 95 |
- properties: |
| 96 |
items: |
| 97 |
minItems: 8 |
| 98 |
maxItems: 8 |
| 99 |
minItems: |
| 100 |
maximum: 7 |
| 101 |
- properties: |
| 102 |
items: |
| 103 |
minItems: 9 |
| 104 |
maxItems: 9 |
| 105 |
minItems: |
| 106 |
maximum: 8 |
| 107 |
- properties: |
| 108 |
items: |
| 109 |
minItems: 10 |
| 110 |
maxItems: 10 |
| 111 |
minItems: |
| 112 |
maximum: 9 |
| 113 |
- properties: |
| 114 |
items: |
| 115 |
minItems: 11 |
| 116 |
maxItems: 11 |
| 117 |
minItems: |
| 118 |
maximum: 10 |
| 119 |
- properties: |
| 120 |
items: |
| 121 |
minItems: 12 |
| 122 |
maxItems: 12 |
| 123 |
minItems: |
| 124 |
maximum: 11 |
| 125 |
- properties: |
| 126 |
items: |
| 127 |
minItems: 13 |
| 128 |
|
| 129 |
... |