Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

XML namespaces in generated YAML metadata files for nested elements confuse Deserializer #73

@holtkamp

Description

@holtkamp

When generating YAML metadata files to be used with JMS Serializer, it seems that for EACH element the XML namespace is defined in the resulting YAML files. Also for nested elements that already 'inherit' their namespace from the root namespace.

For nested elements this seems to confuse the JMS Serializer => the element is not properly detected and the property remains empty. By removing the XML namespace JMS Serializer detects the element again.

For example:

Ideal\Messages\AcquirerErrorRes:
    xml_root_name: AcquirerErrorRes
    xml_root_namespace: 'http://www.idealdesk.com/ideal/messages/mer-acq/3.3.1'
    properties:
        version:
            expose: true
            access_type: public_method
            serialized_name: version
            accessor:
                getter: getVersion
                setter: setVersion
            xml_attribute: true
            type: string
        createDateTimestamp:
            expose: true
            access_type: public_method
            serialized_name: createDateTimestamp
            xml_element:
                namespace: 'http://www.idealdesk.com/ideal/messages/mer-acq/3.3.1'
            accessor:
                getter: getCreateDateTimestamp
                setter: setCreateDateTimestamp
            type: Goetas\Xsd\XsdToPhp\XMLSchema\DateTime

The createDateTimestamp property will not be populated properly.

By removing the snippet

            xml_element:
                namespace: 'http://www.idealdesk.com/ideal/messages/mer-acq/3.3.1'

serialization works again and the createDateTimestamp property is properly populated with a DateTime object.

The used XSD is here: https://github.com/juriansluiman/SlmIdealPayment/blob/master/data/xsd/AcceptantAcquirer.xsd, can provide example XML instances if required

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions