singer_sdk.typing.OneOf#
- class singer_sdk.typing.OneOf#
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: W | type[W]) None #
Initialize OneOf type.
- Parameters:
types – Types to choose from.
- property type_dict: dict#
Get type dictionary.
- Returns:
A dictionary describing the type.