WIP: Support for simpleType restrictions/facets#1303
Open
ch3pjw wants to merge 2 commits intomvantellingen:mainfrom
Open
WIP: Support for simpleType restrictions/facets#1303ch3pjw wants to merge 2 commits intomvantellingen:mainfrom
ch3pjw wants to merge 2 commits intomvantellingen:mainfrom
Conversation
These need sorting by a maintainer, but I want a clear test run against which to verify my forthcoming changes.
...and include in a `facets` class attribute on generated types. This
means that the result of parsing something like
```
<xs:simpleType name="MyEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="a"/>
<xs:enumeration value="b"/>
</xs:restriction>
</xs:simpleType>
```
should yield something like
```
>>> MyEnum = client.get_type('{namespace}MyEnum')
>>> MyEnum.facets.enumeration
["a", "b"]
We do not (yet) attempt to verify the facets hold when parsing XML or
accepting Python data.
|
This should resolve your errors. There are two issues in the file facets.py under the function parse_xml(). 1). You misspelled 'whitespace'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After talking to @mvantellingen via email I've sketched out the first part of restriction/facet handling.
Currently this MR doesn't include a huge amount of testing - I'd like to verify things are heading in the right direction structure-wise first, and get some guidance on what areas are of most concern. Furthermore, this MR doesn't (yet?) include any validation/enforcement if the parsed facets/restrictions - I'm hoping its both desirable and possible to incorporate raising validation failures both on reading XML or building instances of types/elements.
NB: I've disable some tests that were already failing on master 😬