Thread (2 messages) 2 messages, 2 authors, 2026-01-14

Re: [PATCH 07/10] dt-bindings: mtd: Ensure partition node properties are documented

From: Rob Herring <robh@kernel.org>
Date: 2026-01-14 17:47:18
Also in: linux-mmc, lkml

On Wed, Jan 14, 2026 at 7:58 AM Miquel Raynal [off-list ref] wrote:
Hi Rob,
quoted
quoted
quoted
+$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.
quoted
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.
Right, I think v1 is good to go.

Rob
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help