Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Members with nillable=false and maxOccurs=0 still set nillable #142

Merged
merged 1 commit into from
Jun 19, 2012
Merged

Members with nillable=false and maxOccurs=0 still set nillable #142

merged 1 commit into from
Jun 19, 2012

Conversation

anthonyrisinger
Copy link
Contributor

Currently, when an element is optional, but NOT nillable, it's still set
nillable during serialization. However, when nillable=true, the member is
properly skipped. This behavior causes schema validation errors on the client.

Example schema:

    <xs:complexType name="object">
        <xs:sequence>
            [...]
            <xs:element name="id" type="xs:string" minOccurs="0" />
            <xs:element name="account" type="tns:account" minOccurs="0" />
            <xs:element name="last_updated" type="xs:dateTime" minOccurs="0" />
            [...]
        </xs:sequence>
    </xs:complexType>

Rpclib output:

    <tns:object>
        [...]
        <tns:id>4fd7ad136b6b473006000005</tns:id>
        <tns:account xsi:nil="true"/>
        <tns:last_updated xsi:nil="true"/>
        [...]
    </tns:object>

... correct by not caring if nillable when deciding to skip or not.

…llable

Currently, when an element is optional, but NOT nillable, it's still set
nillable during serialization. However, when nillable=true, the member is
properly skipped. This behavior causes schema validation errors on the client.

Example schema:
    <xs:complexType name="object">
        <xs:sequence>
            [...]
            <xs:element name="id" type="xs:string" minOccurs="0" />
            <xs:element name="account" type="tns:account" minOccurs="0" />
            <xs:element name="last_updated" type="xs:dateTime" minOccurs="0" />
            [...]
        </xs:sequence>
    </xs:complexType>

Rpclib output:
    <tns:object>
        [...]
        <tns:id>4fd7ad136b6b473006000005</tns:id>
        <tns:account xsi:nil="true"/>
        <tns:last_updated xsi:nil="true"/>
        [...]
    </tns:object>

... correct by not caring if nillable when deciding to skip or not.
@plq
Copy link
Member

plq commented Jun 19, 2012

this is a subtle change. would you mind adding tests as well?

@plq
Copy link
Member

plq commented Jun 19, 2012

nah, that would be too much of a hassle. your patch makes perfect sense anyway.

plq added a commit that referenced this pull request Jun 19, 2012
…zero

Members with nillable=false and maxOccurs=0 still set nillable
@plq plq merged commit 31fb18d into arskom:master Jun 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants