setAllowDiscriminatedUnions

public final void setAllowDiscriminatedUnions(boolean value)

Enable discriminated unions: variant object types expressed as anyOf with a shared constant discriminator field per variant. oneOf is never used — it is rejected by OpenAI strict mode and silently ignored by Gemini. When false (default), the schema contains no union types beyond null unions.

Parameters

value

The value to set for the AllowDiscriminatedUnions property.