Re: dt-schema non-array items property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 7/11/22 8:23 AM, Krzysztof Kozlowski wrote:
> On 08/07/2022 22:12, Sean Anderson wrote:
>> Hi all,
>> 
>> I'm a bit confused about how the items property is supposed to work.
>> According to meta-schemas/string-array.yaml, the contents of items may
>> be either a list of enum, const, or pattern, or an object with any
>> properties allowed at the top level. However, this last clause doesn't
>> seem to apply. If I try to use it, such as in
>> should-work-but-doesnt-names below, I get
>> 
>> test.yaml: properties:should-work-but-doesnt-names:items: {'enum': ['a', 'b', 'c']} is not of type 'array'
>> 	from schema $id: http://devicetree.org/meta-schemas/string-array.yaml#
>> 
>> What's going on here?
>> 
>> --Sean
>> 
>> %YAML 1.2
>> ---
>> $id: http://devicetree.org/schemas/test.yaml#
>> $schema: http://devicetree.org/meta-schemas/core.yaml#
>> 
>> title: ""
>> maintainers: []
>> unevaluatedProperties: false
>> 
>> properties:
>>   compatible:
>>     const: baz
>> 
>>   verbose-names:
>>     $ref: "/schemas/types.yaml#/definitions/string-array"
>>     minItems: 1
>>     items:
>>       - enum: [a, b, c]
>>       - enum: [a, b, c]
>>       - enum: [a, b, c]
>>  
>>   non-kosher-names:
>>     $ref: "/schemas/types.yaml#/definitions/string-array"
>>     minItems: 1
>>     items:
>>       - enum: &abc [a, b, c]
>>       - enum: *abc
>>       - enum: *abc
>> 
>>   should-work-but-doesnt-names:
>>     $ref: "/schemas/types.yaml#/definitions/string-array"
>>     minItems: 1
> 
> You miss here maxItems, which is not correct (no upper limit). This is
> why array type is expected.

Thanks, that fixes things. Where does this requirement come from? I don't
see it in the meta-schemas/{items,string-array}.yaml.

--Sean



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux