allOfキーワード・パターンのサポート
allOfキーワードを使用して、モデル定義を結合および拡張します。 allOfキーワードは、独立した検証に使用されるオブジェクト定義の配列を取りますが、同時に単一のオブジェクトを構成します。
ノート:
サブスキーマが単純型であるallOfパターンは、現在サポートされていません。
次の項に記載されていないその他のパターンは、サポート対象外とみなす必要があります。
Oracle Integrationでは、次のallOfキーワード・パターンがサポートされます。
- allOf(すべてのサブスキーマが$refとして定義されている場合)
- allOf(すべてのサブスキーマがインラインで定義されている)
- allOf(インラインおよび$refサブスキーマの混在)
- allOf配列型の項目として定義
- allOfトップ・レベル配列の項目として定義
- $refとして定義されるネストされたallOfサブスキーマを持つallOf
- ネストされたallOfサブスキーマがインラインで定義されているallOf
- $refとして定義されるネストされたoneOfサブスキーマを持つallOf
- ネストされたoneOfサブスキーマがインラインで定義されているallOf
- $refとして定義されたネストされたanyOfサブスキーマを持つallOf
- ネストされたanyOfサブスキーマをインラインで定義したallOf
allOf(すべてのサブスキーマが$refとして定義されている場合)
allOfパターンを使用すると、すべてのサブスキーマが参照($ref)として定義されます。 この例では、3つのサブスキーマが参照として定義されています。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"allOf": [
{
"$ref": "#/components/schemas/ItemProperties"
},
{
"$ref": "#/components/schemas/ItemProductionPrivateVO-item"
},
{
"$ref": "#/components/schemas/ItemProductionPrivateVO-item-response-forChildren"
}
]
}
}
}
}
allOf(すべてのサブスキーマがインラインで定義されている)
allOfパターンを使用すると、すべてのサブスキーマがインラインで定義されます。 この例では、2つのサブスキーマがインラインで定義されています。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"allOf": [
{
"required": [
"count",
"hasMore"
],
"type": "object",
"properties": {
"totalResults": {
"type": "integer",
"format": "int32"
},
"count": {
"type": "integer",
"format": "int32"
},
"hasMore": {
"type": "boolean"
}
}
},
{
"type": "object",
"properties": {
"items": {
"title": "Items",
"type": "array",
"description": "The items in the collection.",
"items": {
"$ref": "#/components/schemas/itemsV2-ItemEffCategory-item-response"
},
"x-cardinality": "1"
}
}
}
]
}
}
}
}
allOf(インラインおよび$refサブスキーマの混在)
サブスキーマが参照($ref)とインラインの両方として定義されるallOfパターンを使用できます。 この例では、1つのサブスキーマが参照として定義され、1つのサブスキーマがインラインで定義されています。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"allOf": [
{
"$ref": "#/components/schemas/CollectionProperties"
},
{
"type": "object",
"properties": {
"items": {
"title": "Items",
"type": "array",
"description": "The items in the collection.",
"items": {
"$ref": "#/components/schemas/itemsV2-ItemEffCategory-item-response"
},
"x-cardinality": "1"
}
}
}
]
}
}
}
}
allOf配列型の項目として定義
allOfパターンを使用できます。{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"properties": {
"repeatingElement": {
"description": "The items in the collection.",
"items": {
"allOf": [
{
"$ref": "#/components/schemas/ItemProperties"
},
{
"$ref": "#/components/schemas/ItemProductionPrivateVO-item"
}
]
},
"title": "repeatingElement",
"type": "array",
"x-cardinality": "1"
},
"someStringElement": {
"type": "string"
}
},
"type": "object"
}
}
}
}allOfトップ・レベル配列の項目として定義
最上位の配列の項目として定義されたallOfパターンを使用できます。
{
"components": {
"schemas": {
"Pets": {
"description": "The items in the collection.",
"items": {
"allOf": [
{
"$ref": "#/components/schemas/Cat_Type"
},
{
"$ref": "#/components/schemas/Dog_Type"
}
]
},
"title": "Pets",
"type": "array",
"x-cardinality": "1"
}
}
}
}
$refとして定義されるネストされたallOfサブスキーマを持つallOf
allOfパターンを使用すると、別のallOfがネストされ、参照($ref)として定義されます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"allOf": [
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-patch-item"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-item-patch-request-forChildren"
}
]
},
"ItemRootIccPrivateVO-patch-item": {
"allOf": [
{
"$ref": "#/components/schemas/ItemEffCategoryVO-patch-item"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-updatableFields"
}
],
"title": "Item Extensible Flexfield"
},
"ItemRootIccPrivateVO-item-patch-request-forChildren": {
"type": "object",
"properties": {
"ItemEFFBItem__Details__EFFPrivateVO": {
"type": "array",
"items": {
"$ref": "#/components/schemas/itemsV2-ItemEffCategory-item-patch-request"
},
"x-cardinality": "1"
}
}
}
}
}
}
ネストされたallOfサブスキーマがインラインで定義されているallOf
allOfパターンを使用すると、別のallOfがネストされ、参照($ref)として定義されます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"allOf": [
{
"allOf": [
{
"$ref": "#/components/schemas/ItemEffCategoryVO-patch-item"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-updatableFields"
}
],
"title": "Item Extensible Flexfield"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-item-patch-request-forChildren"
}
]
}
}
}
}
$refとして定義されるネストされたoneOfサブスキーマを持つallOf
参照されるサブスキーマがネストされたoneOffであるallOfパターンを使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"allOf": [
{
"$ref": "#/components/schemas/ItemEffCategoryVO-patch-item"
},
{
"type": "object",
"properties": {
"items": {
"title": "Items",
"type": "array",
"description": "The items in the collection.",
"items": {
"$ref": "#/components/schemas/itemsV2-ItemEffCategory-item-response"
},
"x-cardinality": "1"
}
}
}
]
},
"ItemEffCategoryVO-patch-item": {
"discriminator": {
"propertyName": "CategoryCode",
"mapping": {
"Production": "schemas/ItemProductionPrivateVO-item-response",
"ROOT_ICC": "schemas/ItemRootIccPrivateVO-item-response"
}
},
"oneOf": [
{
"$ref": "schemas/ItemProductionPrivateVO-item-response"
},
{
"$ref": "schemas/ItemRootIccPrivateVO-item-response"
}
]
}
}
}
}
ネストされたoneOfサブスキーマがインラインで定義されているallOf
oneOfがネストされ、インラインで定義されるallOfパターンを使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"allOf": [
{
"$ref": "#/components/schemas/ItemProperties"
},
{
"discriminator": {
"propertyName": "CategoryCode",
"mapping": {
"Production": "#/components/schemas/ItemProductionPrivateVO-item-response",
"ROOT_ICC": "#/components/schemas/ItemRootIccPrivateVO-item-response"
}
},
"oneOf": [
{
"$ref": "#/components/schemas/ItemProductionPrivateVO-item-response"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-item-response"
}
]
}
]
}
}
}
}
$refとして定義されたネストされたanyOfサブスキーマを持つallOf
anyOfサブスキーマが参照($ref)として定義されるallOfパターンを使用できます。{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"allOf": [
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-patch-item"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-item-patch-request-forChildren"
}
]
},
"ItemRootIccPrivateVO-patch-item": {
"anyOf": [
{
"$ref": "#/components/schemas/ItemEffCategoryVO-patch-item"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-updatableFields"
}
],
"title": "Item Extensible Flexfield"
},
"ItemRootIccPrivateVO-item-patch-request-forChildren": {
"type": "object",
"properties": {
"ItemEFFBItem__Details__EFFPrivateVO": {
"type": "array",
"items": {
"$ref": "#/components/schemas/itemsV2-ItemEffCategory-item-patch-request"
},
"x-cardinality": "1"
}
}
}
}
}
}ネストされたanyOfサブスキーマをインラインで定義したallOf
anyOfサブスキーマがインラインで定義されるallofパターンを使用できます。{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"allOf": [
{
"anyOf": [
{
"$ref": "#/components/schemas/ItemEffCategoryVO-patch-item"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-updatableFields"
}
],
"title": "Item Extensible Flexfield"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-item-patch-request-forChildren"
}
]
}
}
}
}