Skip to main content

template_variable_schemas

Schemas for entries on the "template" tag of TemplateModellerConfig schemas.

Module

Functions

improve_template_variable_schema

def improve_template_variable_schema(    spec_dict: dict[str, typing.Any],)> dict[str, typing.Any]:

Annotate template variable field so editors surface better hints.

This inspects the generated OpenAPI components and rewrites the template field definition to differentiate between scalar types (where type is a literal string) and nested types (where type is an object with a single key such as model_slug). The resulting if/then/else schema allows tools such as yaml-language-server to display the expected nested keys instead of only the scalar literals.

validate_extension

def validate_extension(value: Optional[str])> None:

Validate that extension is either None or a string that does not start with '.'.

For instance, should be "csv", not ".csv".

Classes

TemplateVariablesEntryArray

class TemplateVariablesEntryArray(    *,    label: str,    tooltip: Optional[str] = None,    type: Literal['array'],    items: bitfount.runners.config_schemas.template_variable_schemas._TemplateArrayItemsDetails,    minItems: Optional[int] = None,    default: Optional[list[str]] = None,):

Represents a "type: array" template variable entry.

Variables

  • static default : Optional[list[str]]
  • static items : bitfount.runners.config_schemas.template_variable_schemas._TemplateArrayItemsDetails
  • static minItems : Optional[int]
  • static type : Literal['array']

TemplateVariablesEntryBool

class TemplateVariablesEntryBool(    *,    label: str,    tooltip: Optional[str] = None,    type: Literal['boolean'],    default: Optional[bool] = None,):

Represents a "type: boolean" template variable entry.

Variables

  • static default : Optional[bool]
  • static type : Literal['boolean']

TemplateVariablesEntryFilePath

class TemplateVariablesEntryFilePath(    *,    label: str,    tooltip: Optional[str] = None,    type: bitfount.runners.config_schemas.template_variable_schemas._TemplateFilePathTypeEntry,    default: Optional[str] = None,):

Represents a "type: file_path" template variable entry.

Variables

  • static default : Optional[str]
  • static type : bitfount.runners.config_schemas.template_variable_schemas._TemplateFilePathTypeEntry

TemplateVariablesEntryModelSlug

class TemplateVariablesEntryModelSlug(    *,    label: str,    tooltip: Optional[str] = None,    type: bitfount.runners.config_schemas.template_variable_schemas._TemplateModelSlugTypeEntry,):

Represents a "type: model_slug" template variable entry.

Variables

  • static type : bitfount.runners.config_schemas.template_variable_schemas._TemplateModelSlugTypeEntry

TemplateVariablesEntryNumber

class TemplateVariablesEntryNumber(    *,    label: str,    tooltip: Optional[str] = None,    type: Literal['number'],    minimum: Union[int, float, ForwardRef(None)] = None,    default: Union[int, float, ForwardRef(None)] = None,):

Represents a "type: number" template variable entry.

Variables

  • static default : Union[int, float, ForwardRef(None)]
  • static minimum : Union[int, float, ForwardRef(None)]
  • static type : Literal['number']

TemplateVariablesEntrySchemaColumnName

class TemplateVariablesEntrySchemaColumnName(    *,    label: str,    tooltip: Optional[str] = None,    type: bitfount.runners.config_schemas.template_variable_schemas._TemplateSchemaColumnNameTypeEntry,    default: Optional[str] = None,):

Represents a "type: schema_column_name" template variable entry.

Variables

  • static default : Optional[str]
  • static type : bitfount.runners.config_schemas.template_variable_schemas._TemplateSchemaColumnNameTypeEntry

TemplateVariablesEntrySchemaColumnNameArray

class TemplateVariablesEntrySchemaColumnNameArray(    *,    label: str,    tooltip: Optional[str] = None,    type: bitfount.runners.config_schemas.template_variable_schemas._TemplateSchemaColumnNameArrayTypeEntry,    default: Optional[list[str]] = None,):

Represents a "type: schema_column_name_array" template variable entry.

Variables

  • static default : Optional[list[str]]
  • static type : bitfount.runners.config_schemas.template_variable_schemas._TemplateSchemaColumnNameArrayTypeEntry

TemplateVariablesEntryString

class TemplateVariablesEntryString(    *,    label: str,    tooltip: Optional[str] = None,    type: Literal['string'],    pattern: Optional[str] = None,    default: Optional[str] = None,):

Represents a "type: string" template variable entry.

Variables

  • static default : Optional[str]
  • static pattern : Optional[str]
  • static type : Literal['string']

TemplatesMixin

Schema for schemas having a template field.