allOf Keyword Pattern Support

Use the allOf keyword to combine and extend model definitions. The allOf keyword takes an array of object definitions used for independent validation, but together compose a single object.

Note:

The following allOf keyword patterns are not currently supported.
  • allOf defined as items of top level array
  • allOf with a subschema being of simple type

Any other patterns not listed in the following sections should also be considered unsupported.

Oracle Integration supports the following allOf keyword patterns.

allOf with All Subschemas Defined as $ref

You can use an allOf pattern in which all subschemas are defined as references ($ref). For this example, there are three subschemas defined as references.

{
    "components": {
        "schemas": {
            "ItemRootIccPrivateVO-item-patch-request": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ItemProperties"
                    },
                    {
                        "$ref": "#/components/schemas/ItemProductionPrivateVO-item"
                    },
                    {
                        "$ref": "#/components/schemas/ItemProductionPrivateVO-item-response-forChildren"
                    }
                ]
            }
        }
    }
}

allOf with All Subschemas Defined Inline

You can use an allOf pattern in which all subschemas are defined inline. For this example, there are two subschemas defined inline.

{
    "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 with a Mix of Inline and $ref Subschemas

You can use an allOf pattern in which the subschemas are defined both as references ($ref) and inline. For this example, there is one subschema defined as a reference and one subschema defined inline.

{
    "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 Defined as Item of an Array Type

You can use an allOf pattern defined as an item of an array type.
{
    "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 with a Nested allOf Subschema Defined as $ref

You can use an allOf pattern in which another allOf is nested and defined as a reference ($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 with a Nested allOf Subschema Defined Inline

You can use an allOf pattern in which another allOf is nested and defined as a reference ($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"
                    }
                ]
            }
        }
    }
}

allOf with a Nested oneOf Subschema Defined as $ref

You can use an allOf pattern in which a referenced subschema is a nested oneOff.

{
    "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"
                    }
                ]
            }
        }
    }
}

allOf with a Nested oneOf Subschema Defined Inline

You can use an allOf pattern in which a oneOf is nested and defined inline.

{
    "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"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

allOf with a Nested anyOf Subschema Defined as $ref

You can use an allOf pattern in which a nested anyOf subschema is defined as a reference ($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": {
                "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"
                    }
                }
            }
        }
    }
}

allOf with a Nested anyOf Subschema Defined Inline

You can use an allof pattern in which a nested anyOf subschema is defined inline.
{
    "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"
                    }
                ]
            }
        }
    }
}