You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python Codegen] Support plain class style with runtime XML/JSON binding #60
#50 proposed --lang python --style class, but the current generator emits dataclasses or Pydantic models only. polyxml-python discovers fields through __dataclass_fields__ or Pydantic model_fields, so merely omitting @dataclass would produce a class whose XML/JSON fields are invisible to the runtime.
Scope
Define the plain-class field declaration and metadata format, including XML name, namespace, attribute/text kind, defaults, optional fields, and lists.
Add generated --style class output for the Python backend and support it in both [[generate]] and [codegen.python] manifests. Decide whether this style is compatible with Pydantic or restrict it to the standard backend.
Teach the Python runtime to discover, instantiate, serialize, and deserialize these classes, including nested and inherited models and generated from_xml/to_xml/JSON helpers.
Test generated classes end to end, including round trips, default values, field metadata, inheritance, and xsi:type where applicable. Preserve the existing dataclass and Pydantic defaults.
Update the compiler guide's supported-style table when the implementation is complete.
Closing for now. PolyXML already supports generated dataclasses and Pydantic models, while plain classes would require a separate field-metadata and runtime binding path. We can revisit this if a concrete user case needs plain classes.
Activity
nth-bailey commentedon Sep 23, 2026
Closing for now. PolyXML already supports generated dataclasses and Pydantic models, while plain classes would require a separate field-metadata and runtime binding path. We can revisit this if a concrete user case needs plain classes.