Projet

Général

Profil

0005-utils-xml-eplicit-is_element_only-condition-62631.patch

Nicolas Roche, 11 mars 2022 13:00

Télécharger (1,38 ko)

Voir les différences:

Subject: [PATCH 5/9] utils/xml: eplicit is_element_only condition (#62631)

 passerelle/utils/xml.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
passerelle/utils/xml.py
331 331
            base_schema = cls.type_to_jsonschema(xmltype.base_type)
332 332
            if not xmltype.attributes:
333 333
                schema = base_schema
334 334
            else:
335 335
                cls.attributegroup_to_jsonschema(xmltype.attributes)
336 336
                schema['properties']['$'] = base_schema
337 337
            return schema
338 338
        else:
339
            if xmltype.has_mixed_content() or not xmltype.is_element_only():
339
            if xmltype.has_mixed_content() or xmltype.name == xmlschema.qnames.XSD_ANY_TYPE:
340 340
                raise NotImplementedError(xmltype)
341 341

  
342 342
            schema = OrderedDict({'type': 'object'})
343 343
            schema['additionalProperties'] = False
344 344
            if xmltype.attributes:
345 345
                cls.attributegroup_to_jsonschema(xmltype.attributes, schema)
346 346
            cls.group_to_jsonschema(xmltype.content_type, schema)
347 347
            return schema
348
-