Context
#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.
Related: #50, PR #56.
Context
#50 proposed
--lang python --style class, but the current generator emits dataclasses or Pydantic models only.polyxml-pythondiscovers fields through__dataclass_fields__or Pydanticmodel_fields, so merely omitting@dataclasswould produce a class whose XML/JSON fields are invisible to the runtime.Scope
--style classoutput 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.from_xml/to_xml/JSON helpers.xsi:typewhere applicable. Preserve the existing dataclass and Pydantic defaults.Related: #50, PR #56.