-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fixed xml deserialization for missing prefixes #33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@otto-ifak I had a quick look at the change. Can you adjust it in accordance to the comments? Thanks!
@@ -85,8 +85,9 @@ def _tag_replace_namespace(tag: str, nsmap: Dict[str, str]) -> str: | |||
""" | |||
split = tag.split("}") | |||
for prefix, namespace in nsmap.items(): | |||
if namespace == split[0][1:]: | |||
return prefix + ":" + split[1] | |||
if prefix: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which value does prefix
have when the prefix is missing? I would prefer an explicit check for that value (e.g. prefix is not None
, if prefix
were to be None
when the prefix is missing).
if prefix: | ||
if namespace == split[0][1:]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if prefix: | |
if namespace == split[0][1:]: | |
if prefix and namespace == split[0][1:]: |
I just realized that we don't have the right to edit this PR :D |
@s-heppner Done. |
Perfect, thank you! |
* adapter.http: implement the attachment routes * adapter.http: fix codestyle errors * adapter.http: implement recommended changes * adapter.http: implement new recommended changes
The xml deserialization fails when xml tags without prefixes are used.