anyOfキーワード・パターンのサポート
anyOfキーワードを使用して、指定されたデータがサブスキーマに対して有効であることを確認します。
ノート:
サブスキーマが単純型であるanyOfキーワード・パターンは、現在サポートされていません。
次の項に記載されていないその他のパターンは、サポート対象外とみなす必要があります。
Oracle Integrationでは、次のanyOfキーワード・パターンがサポートされます。
- anyOf(すべてのサブスキーマが$refとして定義されている場合)
- anyOf(すべてのサブスキーマをインラインで定義)
- anyOf(サブスキーマがインラインと$refの混在)
- anyOf配列型の項目として定義
- anyOfトップ・レベル配列の項目として定義
- $refとして定義されたネストされたanyOfサブスキーマを持つanyOf
- ネストされたanyOfサブスキーマをインラインで定義したanyOf
- $refとして定義されたネストされたallOfサブスキーマを持つanyOf
- ネストされたallOfサブスキーマをインラインで定義したanyOf
- $refとして定義されたネストされたoneOfサブスキーマを持つanyOf
- ネストされたoneOfサブスキーマをインラインで定義したanyOf
anyOf(すべてのサブスキーマが$refとして定義されている場合)
anyOfパターンを使用すると、すべてのサブスキーマが参照($ref)として定義されます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"anyOf": [
{
"$ref": "#/components/schemas/ItemProperties"
},
{
"$ref": "#/components/schemas/ItemProductionPrivateVO-item"
},
{
"$ref": "#/components/schemas/ItemProductionPrivateVO-item-response-forChildren"
}
]
}
}
}
}
anyOf(すべてのサブスキーマをインラインで定義)
anyOfパターンは、インラインで定義されているすべてのサブスキーマで使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"anyOf": [
{
"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"
}
}
}
]
}
}
}
}
anyOf(サブスキーマがインラインと$refの混在)
anyOfパターンを使用すると、サブスキーマをインラインと参照($ref)の組合せとして使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"anyOf": [
{
"$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"
}
}
}
]
}
}
}
}
anyOf配列型の項目として定義
配列型の項目として定義されたanyOfパターンを使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"properties": {
"repeatingElement": {
"description": "The items in the collection.",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/ItemProperties"
},
{
"$ref": "#/components/schemas/ItemProductionPrivateVO-item"
}
]
},
"title": "repeatingElement",
"type": "array",
"x-cardinality": "1"
},
"someStringElement": {
"type": "string"
}
},
"type": "object"
}
}
}
}
anyOfトップ・レベル配列の項目として定義
最上位の配列の項目として定義されたanyOfパターンを使用できます。
{
"components": {
"schemas": {
"Pets": {
"description": "The items in the collection.",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/Cat_Type"
},
{
"$ref": "#/components/schemas/Dog_Type"
}
]
},
"title": "Pets",
"type": "array",
"x-cardinality": "1"
}
}
}
}
$refとして定義されたネストされたanyOfサブスキーマを持つanyOf
ネストされたanyOfサブスキーマが参照($ref)として定義されるanyOfパターンを使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"anyOf": [
{
"$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サブスキーマをインラインで定義したanyOf
ネストされたanyOfサブスキーマがインラインで定義されるanyOfパターンを使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"anyOf": [
{
"anyOf": [
{
"$ref": "#/components/schemas/ItemEffCategoryVO-patch-item"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-updatableFields"
}
],
"title": "Item Extensible Flexfield"
},
{
"$ref": "#/components/schemas/ItemRootIccPrivateVO-item-patch-request-forChildren"
}
]
}
}
}
}
$refとして定義されたネストされたallOfサブスキーマを持つanyOf
ネストされたallOfサブスキーマが参照($ref)として定義されるanyOfパターンを使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"anyOf": [
{
"$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サブスキーマをインラインで定義したanyOf
ネストされたallOfサブスキーマがインラインで定義されるanyOfパターンを使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"anyOf": [
{
"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サブスキーマを持つanyOf
ネストされたoneOfサブスキーマが参照($ref)として定義されるanyOfパターンを使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"anyOf": [
{
"$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サブスキーマをインラインで定義したanyOf
ネストされたoneOfサブスキーマがインラインで定義されるanyOfパターンを使用できます。
{
"components": {
"schemas": {
"ItemRootIccPrivateVO-item-patch-request": {
"anyOf": [
{
"$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"
}
]
}
]
}
}
}
}