From c8caf1d6d4578795d96bf336478a257903bcf2fb Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 11 Jun 2020 14:25:07 +0200 Subject: [PATCH] utils: adjust condition on ComplexType elements (#43917) We used the wrong property to check for complex-type with are simple-type extensions, as stated by the xmlschema author (https://github.com/sissaschool/xmlschema/issues/195). --- passerelle/utils/xml.py | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/passerelle/utils/xml.py b/passerelle/utils/xml.py index c09124f7..8bcdab1e 100644 --- a/passerelle/utils/xml.py +++ b/passerelle/utils/xml.py @@ -314,7 +314,7 @@ class JSONSchemaFromXMLSchema(object): schema['properties']['$'] = base_schema return schema else: - if xmltype.has_mixed_content() or not xmltype.is_element_only(): + if not xmltype.is_empty() and not xmltype.is_element_only(): raise NotImplementedError(xmltype) schema = OrderedDict({'type': 'object'}) diff --git a/tox.ini b/tox.ini index b45f2853..a5ebdbd6 100644 --- a/tox.ini +++ b/tox.ini @@ -37,7 +37,7 @@ deps = vobject django-ratelimit pyquery - xmlschema<1.1 + py2: xmlschema<1.1 zeep<3.3 commands = ./get_wcs.sh -- 2.26.2