monitor_schema.models.utils#

Common utilities.

Module Contents#

Functions#

anyOf_to_oneOf(→ None)

Turn anyOf in JSON schema to oneOf.

duration_field(→ pydantic.Field)

Duration of a field.

Attributes#

monitor_schema.models.utils.anyOf_to_oneOf(schema: Dict[str, Any], field_name: str) None[source]#

Turn anyOf in JSON schema to oneOf.

onfOf is much stricter and pyDantic doesn’t produce this tag. We hijack the JSON schema object to set this correctly.

See: https://github.com/samuelcolvin/pydantic/issues/656

monitor_schema.models.utils.COLUMN_NAME_TYPE#
monitor_schema.models.utils.METRIC_NAME_STR#
monitor_schema.models.utils.duration_field(description: str, title: Optional[str] = None) pydantic.Field[source]#

Duration of a field.