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

Automatic xml encoding for structs #82

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pmh1wheel
Copy link

This leaves the struct handling alone in recursiveEncode, which is designed to deal with individual xml.Tokens.

Instead, we just use xml.Encode for top-level structs, and leave the formatting up to the struct tags, which allow for plenty of control

…marshaling

Currently requires an explicit Request.UseXMLEncoder flag, but can probably
automatically detect an XMLName field on the request object without breaking
compatibility with requests which might trigger the Struct branch in
recursiveEncode

It's also a slightly uncomfortable mix of creating tokens for later encoding
alongside encoding things directly, but the current interfaces make that hard
to avoid

Tests also still need a bit of work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants