[PATCH 07/10] dt-bindings: mtd: Ensure partition node properties are documented
Miquel Raynal
miquel.raynal at bootlin.com
Wed Jan 14 05:58:35 PST 2026
Hi Rob,
>> > +$defs:
>> > + partition-node:
>> > + type: object
>> > + if:
>> > + not:
>> > + required: [ compatible ]
>> > + then:
>> > + $ref: '#'
>> > + unevaluatedProperties: false
>> > + else:
>> > + $ref: '#'
>>
>> This, however, is total blackmagic to me. Would you mind explaining what
>>
>> $ref: '#'
>>
>> indicates? Is this a placeholder indicating "a reference must be given?
>
> It's what's known as JSON pointers. The '#' is a reference to the top
> level of this schema.
>
>> Also I do not understand the final else case, what is it covering?
>
> It's really just there so a $ref to
> partition.yaml#/$defs/partition-node applies the schema (all of
> partition.yaml) whether there's a compatible property or not.
>
> This all just works around that a schema like this doesn't work:
>
> $ref: foo.yaml
> if:
> ...
> then:
> unevaluatedProperties: false
>
> The evaluation of unevaluatedProperties doesn't "see" the $ref being
> in the parent. So we can't factor out the $ref.
Oooh, ok, fully understood. I think I already faced that problem
before. First time I hear about JSON pointers, thanks a lot for the
heads up.
Regarding this series, it feels like in the end, if I understood the
discussion with Krzysztof correctly, there is no modification to bring?
Let me know if you plan on sending a v2 of if I shall take v1 otherwise.
Thanks,
Miquèl
More information about the linux-mtd
mailing list