Skip to content

ComplexType with single Sequence fails to generate underlying type class #169

@rtek

Description

@rtek

This XSD generates a class that extends a type that doesnt get generated.

<xs:schema xmlns="bug" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="bug">
    <xs:element name="Bugs" type="Bugs"/>
    <xs:complexType name="Bugs">
        <xs:sequence>
            <xs:element name="Bug" type="Bug" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Bug">
        <xs:sequence>
            <xs:element name="Bug" type="xs:string" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>
/**
 * Class representing Bugs
 */
class Bugs extends BugsType //BugsType does not get created
{
}

It appears that BugsType gets flagged as skip here https://github.com/goetas-webservices/xsd2php/blob/master/src/Php/PhpConverter.php#L276

I switched the sequence to a choice as a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions