AnyOfSchema class
Stay organized with collections
Save and categorize content based on your preferences.
Schema class representing a value that can conform to any of the provided sub-schemas. This is useful when a field can accept multiple distinct types or structures.
Signature:
export declare class AnyOfSchema extends Schema
Extends: Schema
Constructors
Properties
AnyOfSchema.(constructor)
Constructs a new instance of the AnyOfSchema
class
Signature:
constructor(schemaParams: SchemaParams & {
anyOf: TypedSchema[];
});
Parameters
AnyOfSchema.anyOf
Signature:
anyOf: TypedSchema[];
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-17 UTC.
[null,null,["Last updated 2025-07-17 UTC."],[],[],null,["# AnyOfSchema class\n\nSchema class representing a value that can conform to any of the provided sub-schemas. This is useful when a field can accept multiple distinct types or structures.\n\n**Signature:** \n\n export declare class AnyOfSchema extends Schema \n\n**Extends:** [Schema](./ai.schema.md#schema_class)\n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|---------------------------------------------------------------------------|-----------|------------------------------------------------------|\n| [(constructor)(schemaParams)](./ai.anyofschema.md#anyofschemaconstructor) | | Constructs a new instance of the `AnyOfSchema` class |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|-----------------------------------------------|-----------|----------------------------------------|-------------|\n| [anyOf](./ai.anyofschema.md#anyofschemaanyof) | | [TypedSchema](./ai.md#typedschema)\\[\\] | |\n\nAnyOfSchema.(constructor)\n-------------------------\n\nConstructs a new instance of the `AnyOfSchema` class\n\n**Signature:** \n\n constructor(schemaParams: SchemaParams & {\n anyOf: TypedSchema[];\n });\n\n#### Parameters\n\n| Parameter | Type | Description |\n|--------------|-------------------------------------------------------------------------------------------------------------------|-------------|\n| schemaParams | [SchemaParams](./ai.schemaparams.md#schemaparams_interface) \\& { anyOf: [TypedSchema](./ai.md#typedschema)\\[\\]; } | |\n\nAnyOfSchema.anyOf\n-----------------\n\n**Signature:** \n\n anyOf: TypedSchema[];"]]