Skip to content

Commit b0b2416

Browse files
committed
clarifications
Signed-off-by: Clemens Vasters <clemens@vasters.com>
1 parent eecc8b0 commit b0b2416

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

draft-vasters-json-structure-conditional-composition.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,41 @@ or
311311
}
312312
~~~
313313

314+
## Enabling the Extensions {#enabling-the-extensions}
315+
316+
The conditional composition extensions can be enabled in a schema or meta-schema
317+
by adding the `JSONSchemaConditionalComposition` key to the `$uses` clause when
318+
referencing the extended meta-schema:
319+
320+
~~~ json
321+
{
322+
"$schema": "https://json-structure.github.io/meta/extended/v0/#",
323+
"$id": "myschema",
324+
"$uses": [
325+
"JSONSchemaConditionalComposition"
326+
],
327+
"oneOf" : [
328+
{ "type": "string" },
329+
{ "type": "number" }
330+
]
331+
}
332+
~~~
333+
334+
Conditional composition is enabled by default in the validation meta-schema:
335+
336+
~~~ json
337+
{
338+
"$schema": "https://json-structure.github.io/meta/validation/v0/#",
339+
"$id": "myschema",
340+
"type": "object",
341+
"oneOf" : [
342+
{ "type": "string" },
343+
{ "type": "number" }
344+
]
345+
}
346+
~~~
347+
348+
314349
# Security Considerations {#security-considerations}
315350

316351
- The use of composition keywords does not alter the security model of JSON Structure Core; however, excessive nesting or overly complex compositions may impact performance and resource usage.

0 commit comments

Comments
 (0)