craft_parts.pydantic_schema module¶
Experiments with pydantic schemas.
- class craft_parts.pydantic_schema.Part(**data)¶
Bases:
BaseModelGeneric schema for all parts.
- Parameters:
data (
Any)
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')¶
Create the JSON schema for a Part.
-
plugin_data:
PluginProperties¶
-
source_data:
Annotated[DebSourceModel|FileSourceModel|GitSourceModel|LocalSourceModel|RpmSourceModel|SevenzipSourceModel|SnapSourceModel|TarSourceModel|ZipSourceModel]¶
- class craft_parts.pydantic_schema.PartsFile(**data)¶
Bases:
BaseModelA root model for a file that contains a ‘parts’ key.
- Parameters:
data (
Any)
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')¶
Create the JSON schema for a file with Parts.