lkml.org 
[lkml]   [2019]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] dt-bindings: power: syscon-reboot: Convert bindings to json-schema
On Tue, 3 Sep 2019 at 15:12, Rob Herring <robh+dt@kernel.org> wrote:
> > arch/arm/boot/dts/exynos3250-artik5-eval.dt.yaml: syscon-reboot:
> > {'regmap': [[9]], 'mask': [[1]], '$nodename': ['syscon-reboot'],
> > 'value': [[1]], 'offset': [[1024]], 'compatible': ['syscon-reboot']}
> > is valid under each of {'required': ['mask']}, {'required': ['value',
> > 'mask']}, {'required': ['value']}
>
> Ahh, right. 'anyOf' is what we want:
>
> anyOf:
> - required: [ value ]
> - required: [ mask ]

This triggers meta-schema error:

SCHEMA Documentation/devicetree/bindings/processed-schema.yaml
Traceback (most recent call last):
File "/home/kozik/.local/lib/python3.5/site-packages/dtschema/lib.py",
line 429, in process_schema
DTValidator.check_schema(schema)
File "/home/kozik/.local/lib/python3.5/site-packages/dtschema/lib.py",
line 575, in check_schema
raise jsonschema.SchemaError.create_from(error)
jsonschema.exceptions.SchemaError: Additional properties are not
allowed ('anyOf' was unexpected)

Failed validating 'additionalProperties' in metaschema['allOf'][0]:
{'$id': 'http://devicetree.org/meta-schemas/base.yaml#',
'$schema': 'http://json-schema.org/draft-07/schema#',
'additionalProperties': False,
'allOf': [{'$ref': 'http://json-schema.org/draft-07/schema#'}],
'description': 'Metaschema for devicetree binding documentation',
'properties': {'$id': {'pattern':
'http://devicetree.org/schemas/.*\\.yaml#'},
'$schema': {'enum':
['http://devicetree.org/meta-schemas/core.yaml#',

'http://devicetree.org/meta-schemas/base.yaml#']},
'additionalProperties': {'type': 'boolean'},
'allOf': {'items': {'propertyNames': {'enum': ['$ref',
'if',
'then',
'else']}}},
'definitions': True,
'dependencies': True,
'description': True,
'else': True,
'examples': {'items': {'type': 'string'},
'type': 'array'},
'if': True,
'maintainers': {'items': {'format': 'email',
'type': 'string'},
'type': 'array'},
'oneOf': True,
'patternProperties': True,
'properties': True,
'required': True,
'select': {'allOf': [{'$ref':
'http://json-schema.org/draft-07/schema#'},
{'oneOf': [{'properties':
{'properties': True,

'required': True},
'type': 'object'},
{'type': 'boolean'}]}]},
'then': True,
'title': {'maxLength': 100},
'unevaluatedProperties': {'type': 'boolean'}},
'required': ['$id', '$schema', 'title', 'maintainers']}

Best regards,
Krzysztof

\
 
 \ /
  Last update: 2019-09-03 15:30    [W:0.036 / U:2.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site