diff mbox series

[v4,3/9] bitbake-setup.schema.json: Use anyOf for non-disjoint subschemas

Message ID 20260619-b4-schema-v4-3-1e25a4651b80@windriver.com
State New
Headers show
Series bitbake-setup JSON Schema: Fix linting errors | expand

Commit Message

Rob Woolley June 19, 2026, 5:39 p.m. UTC
The oneOf keyword is for matching only one subschema. It is intended
to fail validation if the JSON instance validates against more than 1
or zero subschemas.

In this case the possible BitBake configuration fragments
are disjoint and anyOf may be used instead.

This resolves the following jsonschema linting error:
  A `oneOf` where all branches have disjoint types can be safely
  converted to `anyOf` (oneof_to_anyof_disjoint_types)

Reviewed-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
 setup-schema/bitbake-setup.schema.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/setup-schema/bitbake-setup.schema.json b/setup-schema/bitbake-setup.schema.json
index 1830d16df..056ace37a 100644
--- a/setup-schema/bitbake-setup.schema.json
+++ b/setup-schema/bitbake-setup.schema.json
@@ -76,7 +76,7 @@ 
                                 "description": "Human-readable description of the configuration"
                             },
                             "notes": {
-                                "oneOf": [
+                                "anyOf": [
                                     {
                                         "type": "string"
                                     },
@@ -112,7 +112,7 @@ 
                                 "type": "array",
                                 "description": "List of BitBake configuration fragments to enable",
                                 "items": {
-                                    "oneOf": [
+                                    "anyOf": [
                                         {
                                             "type": "string",
                                             "description": "Configuration fragment name"