Skip to content

moddle_types

Type declarations for Moodle plugins.

CLASS DESCRIPTION
LiteralValue

A Moddle literal value.

ModdleEnumeration

A Moddle enumeration.

ModdlePackage

A Moddle package that extends BPMN.

ModdleType

A Moddle type that is part of a Moddle package.

ModdleTypeMeta

Metadata about a Moddle type.

TypeProperty

The definition of a Moddle type property.

XMLSerialization

Defines XML serialization details.

FUNCTION DESCRIPTION
lower_first_char

Lower the first character of a string.

Classes

LiteralValue pydantic-model

Bases: BaseModel

A Moddle literal value.

Show JSON schema:
{
  "description": "A Moddle literal value.",
  "properties": {
    "name": {
      "description": "Value of the literal.",
      "title": "Name",
      "type": "string"
    }
  },
  "required": [
    "name"
  ],
  "title": "LiteralValue",
  "type": "object"
}

Fields:

Attributes

name pydantic-field
name: str

Value of the literal.

ModdleEnumeration pydantic-model

Bases: BaseModel

A Moddle enumeration.

Show JSON schema:
{
  "$defs": {
    "LiteralValue": {
      "description": "A Moddle literal value.",
      "properties": {
        "name": {
          "description": "Value of the literal.",
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "title": "LiteralValue",
      "type": "object"
    }
  },
  "description": "A Moddle enumeration.",
  "properties": {
    "name": {
      "description": "Name of the enumeration.",
      "title": "Name",
      "type": "string"
    },
    "literalValues": {
      "description": "Values of the enumeration.",
      "items": {
        "$ref": "#/$defs/LiteralValue"
      },
      "title": "Literalvalues",
      "type": "array"
    }
  },
  "required": [
    "name",
    "literalValues"
  ],
  "title": "ModdleEnumeration",
  "type": "object"
}

Fields:

Attributes

literal_values pydantic-field
literal_values: list[LiteralValue]

Values of the enumeration.

name pydantic-field
name: str

Name of the enumeration.

ModdlePackage pydantic-model

Bases: BaseModel

A Moddle package that extends BPMN.

Show JSON schema:
{
  "$defs": {
    "LiteralValue": {
      "description": "A Moddle literal value.",
      "properties": {
        "name": {
          "description": "Value of the literal.",
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "title": "LiteralValue",
      "type": "object"
    },
    "ModdleEnumeration": {
      "description": "A Moddle enumeration.",
      "properties": {
        "name": {
          "description": "Name of the enumeration.",
          "title": "Name",
          "type": "string"
        },
        "literalValues": {
          "description": "Values of the enumeration.",
          "items": {
            "$ref": "#/$defs/LiteralValue"
          },
          "title": "Literalvalues",
          "type": "array"
        }
      },
      "required": [
        "name",
        "literalValues"
      ],
      "title": "ModdleEnumeration",
      "type": "object"
    },
    "ModdlePackage": {
      "description": "A Moddle package that extends BPMN.",
      "properties": {
        "name": {
          "description": "Name of the package.",
          "title": "Name",
          "type": "string"
        },
        "prefix": {
          "description": "The prefix uniquely identifies elements in a package if more multiple packages are in place.",
          "title": "Prefix",
          "type": "string"
        },
        "uri": {
          "description": "The associated XML namespace URI.",
          "title": "Uri",
          "type": "string"
        },
        "xml": {
          "anyOf": [
            {
              "$ref": "#/$defs/XMLSerialization"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Defines XML serialization details."
        },
        "types": {
          "description": "Types contained in the package.",
          "items": {
            "$ref": "#/$defs/ModdleType"
          },
          "title": "Types",
          "type": "array"
        },
        "enumerations": {
          "description": "Enumerations contained in the package.",
          "items": {
            "$ref": "#/$defs/ModdleEnumeration"
          },
          "title": "Enumerations",
          "type": "array"
        },
        "enums": {
          "anyOf": [
            {
              "additionalProperties": {
                "description": "Enum where members are also (and must be) strings",
                "enum": []
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "description": "Python StrEnums from enumerations defined in the package.",
          "title": "Enums"
        }
      },
      "required": [
        "name",
        "prefix",
        "uri",
        "types"
      ],
      "title": "ModdlePackage",
      "type": "object"
    },
    "ModdleType": {
      "description": "A Moddle type that is part of a Moddle package.",
      "properties": {
        "name": {
          "description": "Name of the type.",
          "title": "Name",
          "type": "string"
        },
        "tag": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "XML tag name to parse.",
          "title": "Tag"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Description of the type.",
          "title": "Description"
        },
        "superClass": {
          "description": "Names of the super classes.",
          "items": {
            "type": "string"
          },
          "title": "Superclass",
          "type": "array"
        },
        "extends": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "Name of the type to extend.",
          "title": "Extends"
        },
        "isAbstract": {
          "default": false,
          "description": "Is the type abstract?",
          "title": "Isabstract",
          "type": "boolean"
        },
        "meta": {
          "anyOf": [
            {
              "$ref": "#/$defs/ModdleTypeMeta"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Metadata about this plugin type."
        },
        "properties": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TypeProperty"
          },
          "description": "Properties contained in the type.",
          "title": "Properties"
        },
        "normalized_name": {
          "anyOf": [
            {
              "$ref": "#/$defs/QName"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Normalized name of the type. Set during type registration."
        },
        "traits": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/QName"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "Traits described by other type's extends property.",
          "title": "Traits"
        },
        "package": {
          "anyOf": [
            {
              "$ref": "#/$defs/ModdlePackage"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The package this type belongs to. Set during registration."
        },
        "normalized_extends": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/QName"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Normalized extends of the type. Set during registration.",
          "title": "Normalized Extends"
        },
        "normalized_superclass": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/QName"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Normalized superclass of the type. Set during registration.",
          "title": "Normalized Superclass"
        }
      },
      "required": [
        "name"
      ],
      "title": "ModdleType",
      "type": "object"
    },
    "ModdleTypeMeta": {
      "description": "Metadata about a Moddle type.",
      "properties": {
        "allowedIn": {
          "description": "List of elements this plugin type is allowed in.",
          "items": {
            "type": "string"
          },
          "title": "Allowedin",
          "type": "array"
        }
      },
      "required": [
        "allowedIn"
      ],
      "title": "ModdleTypeMeta",
      "type": "object"
    },
    "QName": {
      "properties": {
        "local": {
          "title": "Local",
          "type": "string"
        },
        "uri": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Uri"
        }
      },
      "required": [
        "local"
      ],
      "title": "QName",
      "type": "object"
    },
    "TypeProperty": {
      "description": "The definition of a Moddle type property.",
      "properties": {
        "name": {
          "description": "Name of the property.",
          "title": "Name",
          "type": "string"
        },
        "type": {
          "description": "Type of the property.",
          "title": "Type",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Description of the property.",
          "title": "Description"
        },
        "isAttr": {
          "default": false,
          "description": "Is the property serialized as XML attribute?.",
          "title": "Isattr",
          "type": "boolean"
        },
        "isId": {
          "default": false,
          "description": "Is current property map to XML node id?",
          "title": "Isid",
          "type": "boolean"
        },
        "isMany": {
          "default": false,
          "description": "Is the property an array or a single?",
          "title": "Ismany",
          "type": "boolean"
        },
        "isBody": {
          "default": false,
          "description": "Is the property serialized as body element?",
          "title": "Isbody",
          "type": "boolean"
        },
        "isReference": {
          "default": false,
          "description": "Is the property referencing to another element?",
          "title": "Isreference",
          "type": "boolean"
        },
        "isVirtual": {
          "default": false,
          "description": "Is the property a virtual property (not serialized)?",
          "title": "Isvirtual",
          "type": "boolean"
        },
        "default": {
          "default": null,
          "description": "Default value of the property.",
          "title": "Default"
        },
        "redefines": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the property to redefine.",
          "title": "Redefines"
        },
        "replaces": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the property to replace.",
          "title": "Replaces"
        },
        "xml": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Defines XML serialization details.",
          "title": "Xml"
        },
        "normalized_name": {
          "anyOf": [
            {
              "$ref": "#/$defs/QName"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Normalized name of the property. Set during property registration."
        },
        "normalized_type": {
          "anyOf": [
            {
              "$ref": "#/$defs/QName"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Normalized type of the property. Set during property registration."
        }
      },
      "required": [
        "name",
        "type"
      ],
      "title": "TypeProperty",
      "type": "object"
    },
    "XMLSerialization": {
      "description": "Defines XML serialization details.",
      "properties": {
        "tagAlias": {
          "default": "lowerCase",
          "title": "Tagalias",
          "type": "string"
        },
        "typePrefix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Typeprefix"
        }
      },
      "title": "XMLSerialization",
      "type": "object"
    }
  },
  "$ref": "#/$defs/ModdlePackage"
}

Fields:

Attributes

enumerations pydantic-field
enumerations: list[ModdleEnumeration]

Enumerations contained in the package.

enums pydantic-field

Python StrEnums from enumerations defined in the package.

name pydantic-field
name: str

Name of the package.

prefix pydantic-field
prefix: str

The prefix uniquely identifies elements in a package if more multiple packages are in place.

types pydantic-field
types: list[ModdleType]

Types contained in the package.

uri pydantic-field
uri: str

The associated XML namespace URI.

use_lowercase property
use_lowercase: bool

Check if the property name should be lowercased.

xml pydantic-field

Defines XML serialization details.

Functions

finalize_enums
finalize_enums() -> None

Finalize the enumeration definitions.

finalize_type
finalize_type(moddle_type: ModdleType, nsmap: dict[str, str]) -> None

Finish setting up a Moddle type.

get_type_by_name
get_type_by_name(name: str) -> Optional[ModdleType | StrEnum]

Get a Moddle plugin by name.

model_post_init
model_post_init(context: Any) -> None

Finish initialization of the types and their properties.

package_dependencies
package_dependencies() -> tuple[str, ...]

Return the package URIs this package depends on.

type_dependencies
type_dependencies() -> dict[QName, set[QName]]

A dictionary of type names and their dependencies.

type_dependency_tree
type_dependency_tree() -> tuple[QName, ...]

Create a dependency tree for this package’s types in the correct order.

ModdleType pydantic-model

Bases: BaseModel

A Moddle type that is part of a Moddle package.

Show JSON schema:
{
  "$defs": {
    "LiteralValue": {
      "description": "A Moddle literal value.",
      "properties": {
        "name": {
          "description": "Value of the literal.",
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "title": "LiteralValue",
      "type": "object"
    },
    "ModdleEnumeration": {
      "description": "A Moddle enumeration.",
      "properties": {
        "name": {
          "description": "Name of the enumeration.",
          "title": "Name",
          "type": "string"
        },
        "literalValues": {
          "description": "Values of the enumeration.",
          "items": {
            "$ref": "#/$defs/LiteralValue"
          },
          "title": "Literalvalues",
          "type": "array"
        }
      },
      "required": [
        "name",
        "literalValues"
      ],
      "title": "ModdleEnumeration",
      "type": "object"
    },
    "ModdlePackage": {
      "description": "A Moddle package that extends BPMN.",
      "properties": {
        "name": {
          "description": "Name of the package.",
          "title": "Name",
          "type": "string"
        },
        "prefix": {
          "description": "The prefix uniquely identifies elements in a package if more multiple packages are in place.",
          "title": "Prefix",
          "type": "string"
        },
        "uri": {
          "description": "The associated XML namespace URI.",
          "title": "Uri",
          "type": "string"
        },
        "xml": {
          "anyOf": [
            {
              "$ref": "#/$defs/XMLSerialization"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Defines XML serialization details."
        },
        "types": {
          "description": "Types contained in the package.",
          "items": {
            "$ref": "#/$defs/ModdleType"
          },
          "title": "Types",
          "type": "array"
        },
        "enumerations": {
          "description": "Enumerations contained in the package.",
          "items": {
            "$ref": "#/$defs/ModdleEnumeration"
          },
          "title": "Enumerations",
          "type": "array"
        },
        "enums": {
          "anyOf": [
            {
              "additionalProperties": {
                "description": "Enum where members are also (and must be) strings",
                "enum": []
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "description": "Python StrEnums from enumerations defined in the package.",
          "title": "Enums"
        }
      },
      "required": [
        "name",
        "prefix",
        "uri",
        "types"
      ],
      "title": "ModdlePackage",
      "type": "object"
    },
    "ModdleType": {
      "description": "A Moddle type that is part of a Moddle package.",
      "properties": {
        "name": {
          "description": "Name of the type.",
          "title": "Name",
          "type": "string"
        },
        "tag": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "XML tag name to parse.",
          "title": "Tag"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Description of the type.",
          "title": "Description"
        },
        "superClass": {
          "description": "Names of the super classes.",
          "items": {
            "type": "string"
          },
          "title": "Superclass",
          "type": "array"
        },
        "extends": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "Name of the type to extend.",
          "title": "Extends"
        },
        "isAbstract": {
          "default": false,
          "description": "Is the type abstract?",
          "title": "Isabstract",
          "type": "boolean"
        },
        "meta": {
          "anyOf": [
            {
              "$ref": "#/$defs/ModdleTypeMeta"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Metadata about this plugin type."
        },
        "properties": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TypeProperty"
          },
          "description": "Properties contained in the type.",
          "title": "Properties"
        },
        "normalized_name": {
          "anyOf": [
            {
              "$ref": "#/$defs/QName"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Normalized name of the type. Set during type registration."
        },
        "traits": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/QName"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "Traits described by other type's extends property.",
          "title": "Traits"
        },
        "package": {
          "anyOf": [
            {
              "$ref": "#/$defs/ModdlePackage"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The package this type belongs to. Set during registration."
        },
        "normalized_extends": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/QName"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Normalized extends of the type. Set during registration.",
          "title": "Normalized Extends"
        },
        "normalized_superclass": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/QName"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Normalized superclass of the type. Set during registration.",
          "title": "Normalized Superclass"
        }
      },
      "required": [
        "name"
      ],
      "title": "ModdleType",
      "type": "object"
    },
    "ModdleTypeMeta": {
      "description": "Metadata about a Moddle type.",
      "properties": {
        "allowedIn": {
          "description": "List of elements this plugin type is allowed in.",
          "items": {
            "type": "string"
          },
          "title": "Allowedin",
          "type": "array"
        }
      },
      "required": [
        "allowedIn"
      ],
      "title": "ModdleTypeMeta",
      "type": "object"
    },
    "QName": {
      "properties": {
        "local": {
          "title": "Local",
          "type": "string"
        },
        "uri": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Uri"
        }
      },
      "required": [
        "local"
      ],
      "title": "QName",
      "type": "object"
    },
    "TypeProperty": {
      "description": "The definition of a Moddle type property.",
      "properties": {
        "name": {
          "description": "Name of the property.",
          "title": "Name",
          "type": "string"
        },
        "type": {
          "description": "Type of the property.",
          "title": "Type",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Description of the property.",
          "title": "Description"
        },
        "isAttr": {
          "default": false,
          "description": "Is the property serialized as XML attribute?.",
          "title": "Isattr",
          "type": "boolean"
        },
        "isId": {
          "default": false,
          "description": "Is current property map to XML node id?",
          "title": "Isid",
          "type": "boolean"
        },
        "isMany": {
          "default": false,
          "description": "Is the property an array or a single?",
          "title": "Ismany",
          "type": "boolean"
        },
        "isBody": {
          "default": false,
          "description": "Is the property serialized as body element?",
          "title": "Isbody",
          "type": "boolean"
        },
        "isReference": {
          "default": false,
          "description": "Is the property referencing to another element?",
          "title": "Isreference",
          "type": "boolean"
        },
        "isVirtual": {
          "default": false,
          "description": "Is the property a virtual property (not serialized)?",
          "title": "Isvirtual",
          "type": "boolean"
        },
        "default": {
          "default": null,
          "description": "Default value of the property.",
          "title": "Default"
        },
        "redefines": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the property to redefine.",
          "title": "Redefines"
        },
        "replaces": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the property to replace.",
          "title": "Replaces"
        },
        "xml": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Defines XML serialization details.",
          "title": "Xml"
        },
        "normalized_name": {
          "anyOf": [
            {
              "$ref": "#/$defs/QName"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Normalized name of the property. Set during property registration."
        },
        "normalized_type": {
          "anyOf": [
            {
              "$ref": "#/$defs/QName"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Normalized type of the property. Set during property registration."
        }
      },
      "required": [
        "name",
        "type"
      ],
      "title": "TypeProperty",
      "type": "object"
    },
    "XMLSerialization": {
      "description": "Defines XML serialization details.",
      "properties": {
        "tagAlias": {
          "default": "lowerCase",
          "title": "Tagalias",
          "type": "string"
        },
        "typePrefix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Typeprefix"
        }
      },
      "title": "XMLSerialization",
      "type": "object"
    }
  },
  "$ref": "#/$defs/ModdleType"
}

Fields:

Attributes

description pydantic-field
description: Optional[str] = None

Description of the type.

extends pydantic-field
extends: Optional[list[str]]

Name of the type to extend.

isAbstract pydantic-field
isAbstract: bool = False

Is the type abstract?

meta pydantic-field
meta: Optional[ModdleTypeMeta] = None

Metadata about this plugin type.

name pydantic-field
name: str

Name of the type.

normalized_extends pydantic-field
normalized_extends: Optional[list[QName]] = None

Normalized extends of the type. Set during registration.

normalized_name pydantic-field
normalized_name: Optional[QName] = None

Normalized name of the type. Set during type registration.

normalized_superclass pydantic-field
normalized_superclass: Optional[list[QName]] = None

Normalized superclass of the type. Set during registration.

package pydantic-field
package: Optional[ModdlePackage] = None

The package this type belongs to. Set during registration.

properties pydantic-field
properties: list[TypeProperty]

Properties contained in the type.

superClass pydantic-field
superClass: list[str]

Names of the super classes.

tag pydantic-field
tag: Optional[str] = None

XML tag name to parse.

traits pydantic-field
traits: Optional[list[QName]]

Traits described by other type’s extends property.

ModdleTypeMeta pydantic-model

Bases: BaseModel

Metadata about a Moddle type.

Show JSON schema:
{
  "description": "Metadata about a Moddle type.",
  "properties": {
    "allowedIn": {
      "description": "List of elements this plugin type is allowed in.",
      "items": {
        "type": "string"
      },
      "title": "Allowedin",
      "type": "array"
    }
  },
  "required": [
    "allowedIn"
  ],
  "title": "ModdleTypeMeta",
  "type": "object"
}

Fields:

Attributes

allowed_in pydantic-field
allowed_in: list[str]

List of elements this plugin type is allowed in.

TypeProperty pydantic-model

Bases: BaseModel

The definition of a Moddle type property.

Show JSON schema:
{
  "$defs": {
    "QName": {
      "properties": {
        "local": {
          "title": "Local",
          "type": "string"
        },
        "uri": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Uri"
        }
      },
      "required": [
        "local"
      ],
      "title": "QName",
      "type": "object"
    }
  },
  "description": "The definition of a Moddle type property.",
  "properties": {
    "name": {
      "description": "Name of the property.",
      "title": "Name",
      "type": "string"
    },
    "type": {
      "description": "Type of the property.",
      "title": "Type",
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Description of the property.",
      "title": "Description"
    },
    "isAttr": {
      "default": false,
      "description": "Is the property serialized as XML attribute?.",
      "title": "Isattr",
      "type": "boolean"
    },
    "isId": {
      "default": false,
      "description": "Is current property map to XML node id?",
      "title": "Isid",
      "type": "boolean"
    },
    "isMany": {
      "default": false,
      "description": "Is the property an array or a single?",
      "title": "Ismany",
      "type": "boolean"
    },
    "isBody": {
      "default": false,
      "description": "Is the property serialized as body element?",
      "title": "Isbody",
      "type": "boolean"
    },
    "isReference": {
      "default": false,
      "description": "Is the property referencing to another element?",
      "title": "Isreference",
      "type": "boolean"
    },
    "isVirtual": {
      "default": false,
      "description": "Is the property a virtual property (not serialized)?",
      "title": "Isvirtual",
      "type": "boolean"
    },
    "default": {
      "default": null,
      "description": "Default value of the property.",
      "title": "Default"
    },
    "redefines": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Name of the property to redefine.",
      "title": "Redefines"
    },
    "replaces": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Name of the property to replace.",
      "title": "Replaces"
    },
    "xml": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Defines XML serialization details.",
      "title": "Xml"
    },
    "normalized_name": {
      "anyOf": [
        {
          "$ref": "#/$defs/QName"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Normalized name of the property. Set during property registration."
    },
    "normalized_type": {
      "anyOf": [
        {
          "$ref": "#/$defs/QName"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Normalized type of the property. Set during property registration."
    }
  },
  "required": [
    "name",
    "type"
  ],
  "title": "TypeProperty",
  "type": "object"
}

Config:

  • arbitrary_types_allowed: True

Fields:

Attributes

default pydantic-field
default: Any = None

Default value of the property.

description pydantic-field
description: Optional[str] = None

Description of the property.

is_attr pydantic-field
is_attr: bool = False

Is the property serialized as XML attribute?.

is_body pydantic-field
is_body: bool = False

Is the property serialized as body element?

is_id pydantic-field
is_id: bool = False

Is current property map to XML node id?

is_many pydantic-field
is_many: bool = False

Is the property an array or a single?

is_reference pydantic-field
is_reference: bool = False

Is the property referencing to another element?

is_virtual pydantic-field
is_virtual: bool = False

Is the property a virtual property (not serialized)?

name pydantic-field
name: str

Name of the property.

normalized_name pydantic-field
normalized_name: Optional[QName] = None

Normalized name of the property. Set during property registration.

normalized_type pydantic-field
normalized_type: Optional[QName] = None

Normalized type of the property. Set during property registration.

redefines pydantic-field
redefines: Optional[str] = None

Name of the property to redefine.

replaces pydantic-field
replaces: Optional[str] = None

Name of the property to replace.

type pydantic-field
type: str

Type of the property.

xml pydantic-field
xml: Optional[Mapping[str, str]] = None

Defines XML serialization details.

XMLSerialization pydantic-model

Bases: BaseModel

Defines XML serialization details.

Show JSON schema:
{
  "description": "Defines XML serialization details.",
  "properties": {
    "tagAlias": {
      "default": "lowerCase",
      "title": "Tagalias",
      "type": "string"
    },
    "typePrefix": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Typeprefix"
    }
  },
  "title": "XMLSerialization",
  "type": "object"
}

Fields:

Functions

lower_first_char

lower_first_char(string: str) -> str

Lower the first character of a string.