OpenFactory Applications Schemas#

Pydantic schemas for validating OpenFactory Application definitions.

class openfactory.schemas.apps.OpenFactoryApp(**data)[source]#

Bases: BaseModel

OpenFactory Application Schema.

environment: Optional[List[str]]#
image: str#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

uuid: str#
class openfactory.schemas.apps.OpenFactoryAppsConfig(**data)[source]#

Bases: BaseModel

OpenFactory Applications Configuration Schema.

apps: Dict[str, OpenFactoryApp]#
property apps_dict#

Dictionary with all configured OpenFactory applications.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

openfactory.schemas.apps.get_apps_from_config_file(apps_yaml_config_file, uns_schema)[source]#

Load, validate, and enrich OpenFactory application configurations from a YAML file using UNS metadata.

This function reads a YAML file containing OpenFactory application definitions, validates its content using the OpenFactoryAppsConfig Pydantic model, and augments each validated application entry with Unified Namespace (UNS) metadata derived from the provided schema.

Return type:

Optional[Dict[str, OpenFactoryApp]]

Parameters:
  • apps_yaml_config_file (str) – Path to the YAML file defining application configurations.

  • uns_schema (UNSSchema) – Schema instance used to extract and validate UNS metadata for each application.

Returns:

Optional[Dict[str, OpenFactoryApp]]

A dictionary of validated and enriched application configurations,

or None if validation fails.

Note

In case of validation errors, user notifications will be triggered and None will be returned.