-
Notifications
You must be signed in to change notification settings - Fork 19
feat: implement XML filter for Pydantic/dictionary/deserializable string #59
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
feat: implement XML filter for Pydantic/dictionary/deserializable string #59
Conversation
masci
left a comment
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 you fix the linter we're good to go!
src/banks/filters/xml.py
Outdated
|
|
||
| def xml(value: Union[str, BaseModel, Dict[str, Any]]) -> str: | ||
| """ | ||
| Convert a Pydatic model, a deserializable string or a dictionary into an XML string. |
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.
| Convert a Pydatic model, a deserializable string or a dictionary into an XML string. | |
| Convert a Pydantic model, a deserializable string or a dictionary into an XML string. |
|
Ok, I broke everything, let me revert it and fix it |
|
I think the test failure is not related to my change(?) |
masci
left a comment
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.
🚀
As per title, I implemented a
to_xmlfilter that turns Pydantic models, dictionaries and deserializable strings into XML representations.Here is an example usage (reported also in the docs):
This will output: