-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
Empty array/list parses as None #923
Comments
If I comment out lines 160-161 in xsd/types/complex.py
it works as expected. |
This change breaks 3 test cases:
For test_any_optional, I can't really tell what the expected behaviour could be. For test_build_sequence_with_optional_elements, I'd say: works as expected if we want the wrapper element (item_2) to be significant. Also I think the test case is wrong, item_2 shouldn't be empty. AFAIK, xsi:nillable="true" doesn't imply minOccurs=0. For test_nested_complex_type_optional, kind of the same as test_build_sequence_with_optional_elements. Also: item_2 itself shouldn't be empty? It should contain a sequence of elements, of which at least one (item_2b) is not optional. |
I have the same issue, I will try you solution @apexo |
So I have a WSDL with a request that contains an optional repeatable element <list-entry> (minOccurs=0, maxOccours=unbounded) that is wrapped in another element (<list-wrapper>) .
The sample script parses this document:
as follows (kind of expected):
while
is parsed as
I find this a bit surprising. IMO, the latter should parse as
Otherwise it is impossible to tell whether <list-wrapper> itself was present in the request or not (if <list-wrapper> were optional in the WSDL which it is not in the reduced sample). But whether the wrapper is present or not sometimes makes a semantic difference. And that's my problem. Thank you for your attention.
The text was updated successfully, but these errors were encountered: