UnionProperty
Represents a JSON Schema union property.
Use oneOf when exactly one branch must match, or anyOf when one or more
branches may match. Exactly one composition field MUST be provided with at
least one branch; oneOf and anyOf MUST NOT both be populated. The
alternatives are full Prompty properties so unions remain portable across
generated runtimes.
Class Diagram
Section titled “Class Diagram”---
title: UnionProperty
config:
look: handDrawn
theme: colorful
class:
hideEmptyMembersBox: true
---
classDiagram
class Property {
+string name
+string kind
+string description
+boolean required
+boolean nullable
+unknown default
+unknown example
+unknown[] enumValues
}
Property <|-- UnionProperty
class UnionProperty {
+string kind
+Property[] oneOf
+Property[] anyOf
}
class Property {
+string kind
+string description
+boolean required
+boolean nullable
+unknown default
+unknown example
+unknown[] enumValues
}
UnionProperty *-- Property
class Property {
+string kind
+string description
+boolean required
+boolean nullable
+unknown default
+unknown example
+unknown[] enumValues
}
UnionProperty *-- Property
Yaml Example
Section titled “Yaml Example”anyOf: - kind: string - kind: booleanProperties
Section titled “Properties”| Name | Type | Description |
|---|---|---|
| kind | string | |
| oneOf | Property[] | Alternative property schemas where exactly one branch must match |
| anyOf | Property[] | Alternative property schemas where one or more branches may match |
Composed Types
Section titled “Composed Types”The following types are composed within UnionProperty: