Skip to content

boolean serialised with uppercase first letter #126

@maurosilber

Description

@maurosilber

I'm not sure if this is an invalid XML, but in https://www.w3.org/TR/xmlschema-2/#boolean says that the valid values are {true, false, 1, 0}:

from pydantic_xml import BaseXmlModel, attr


class Model(BaseXmlModel):
    x: bool = attr()


print(
    Model
    .from_xml(b'<Model x="true" />')
    .to_xml()
    .decode()
)
<Model x="True"/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions