singer_sdk.typing.Property#
- class singer_sdk.typing.Property#
Generic Property. Should be nested within a PropertiesList.
- __init__(name: str, wrapped: W | type[W], required: bool = False, default: _JsonValue | None = None, description: str | None = None, secret: bool | None = False, allowed_values: list[Any] | None = None, examples: list[Any] | None = None) None #
Initialize Property object.
Note: Properties containing secrets should be specified with secret=True. Doing so will add the annotation writeOnly=True, in accordance with JSON Schema Draft 7 and later, and secret=True as an additional hint to readers.
More info: https://json-schema.org/draft-07/json-schema-release-notes.html
- Parameters:
name – Property name.
wrapped – JSON Schema type of the property.
required – Whether this is a required property.
default – Default value in the JSON Schema.
description – Long-text property description.
secret – True if this is a credential or other secret.
allowed_values – A list of allowed value options, if only specific values are permitted. This will define the type as an ‘enum’.
examples – Optional. A list of one or more sample values. These may be displayed to the user as hints of the expected format of inputs.
- to_dict() dict #
Return a dict mapping the property name to its definition.
- Returns:
A JSON Schema dictionary describing the object.
- property type_dict: dict#
Get type dictionary.
- Returns:
A dictionary describing the type.
- Raises:
ValueError – If the type dict is not valid.