Skip to content

Commit

Permalink
meta-schemas: Ensure json-schema vocab aren't DT property names
Browse files Browse the repository at this point in the history
It's very easy to define json-schema vocabulary as DT properties by
mistake if the indentation is wrong.

There's unlikely to be much overlap. 'type' is one such case though.

Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
robherring committed Apr 30, 2020
1 parent de18b4f commit 7d7bafe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions meta-schemas/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ definitions:
$ref: "string-array.yaml"
memory-region:
$ref: "cell.yaml#array"
propertyNames:
# Ensure DT property names are not json-schema vocabulary names
not:
enum: [ $ref, additionalItems, additionalProperties, allOf, anyOf,
const, contains, default, dependencies, deprecated, description,
else, enum, if, items, maxItems, maximum, minItems, minimum,
multipleOf, not, oneOf, pattern, patternProperties, properties,
propertyNames, required, then, unevaluatedProperties ]

patternProperties:
'.*-names$':
$ref: "string-array.yaml"
Expand Down

0 comments on commit 7d7bafe

Please sign in to comment.