singer_sdk.typing.OneOf

class singer_sdk.typing.OneOf[source]

OneOf type.

This type allows for a value to be one of a set of types.

Examples

>>> t = OneOf(StringType, IntegerType)
>>> print(t.to_json(indent=2))
{
    "oneOf": [
        {
            "type": [
                "string"
            ]
        },
        {
            "type": [
                "integer"
            ]
        }
    ]
}
__init__(*types)[source]

Initialize OneOf type.

Parameters:

types (W | type[W]) – Types to choose from.

Return type:

None

property type_dict: dict[source]

Get type dictionary.

Returns:

A dictionary describing the type.