Skip to content
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

Support encoding and decoding XML unions #52

Merged
merged 1 commit into from
Mar 3, 2025
Merged

Support encoding and decoding XML unions #52

merged 1 commit into from
Mar 3, 2025

Conversation

einarmo
Copy link
Contributor

@einarmo einarmo commented Mar 3, 2025

Not a complicated change. I also remove all traces of FromXml in this PR, since those were left behind after the refactor. We no longer use them, and don't want the burden of maintaining the macros.

The encoding/decoding impl is very similar to the one for JSON. Again ignoring the switch field on decoding, since the information is present in the tag name.

I want to improve the support of unions in custom structs, write a few more tests, implement a system for complete decoding fallbacks, and then I think encoding is pretty much complete. This is a part of the OPC-UA standard that is hard to implement and quite core, so it's nice to have fairly complete support in this library. There are probably some details around matrices and stuff that we don't support yet, but without a clear example I don't really know what to do there. We'll wait until we actually get a user that needs that stuff before we invest in it, I think.

Not a complicated change. I also remove all traces of FromXml in this
PR, since those were left behind after the refactor. We no longer use
them, and don't want the burden of maintaining the macros.
Copy link
Member

@oroulet oroulet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did not review closely but that seems quite a bunch of cleaning up and does not breaks tests so...

@einarmo einarmo merged commit 413331e into master Mar 3, 2025
6 checks passed
@einarmo einarmo deleted the xml-unions branch March 3, 2025 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants