Return mapping of xsd attribute name to a tuple that consists of: - Extensions attribute name - Extensions attribute type type - subattribute name
(extensions: Extensions)
| 15 | |
| 16 | |
| 17 | def get_extensions_attributes(extensions: Extensions) -> dict[str, AttributeData]: |
| 18 | """Return mapping of xsd attribute name to a tuple that consists of: |
| 19 | - Extensions attribute name |
| 20 | - Extensions attribute type type |
| 21 | - subattribute name""" |
| 22 | possible_attributes = {} |
| 23 | for field in fields(type(extensions)): |
| 24 | field_type = field.type.__args__[0] # pyright: ignore [reportAttributeAccessIssue] |
| 25 | subfield = next(iter(fields(field_type))) |
| 26 | xsd_name = subfield.metadata["name"] |
| 27 | possible_attributes[field.name] = AttributeData(field_type, subfield.name, xsd_name) |
| 28 | |
| 29 | return possible_attributes |
no test coverage detected