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

Optional support of unexpected elements #13

Open
cbrow111 opened this issue Nov 17, 2023 · 2 comments
Open

Optional support of unexpected elements #13

cbrow111 opened this issue Nov 17, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@cbrow111
Copy link

Because encode/xml discards anything that isn't handled explicitly, unexpected changes would result in lost data. Golang provides the ,any and ,any,attr tags to handle elements that aren't explicitly mapped. Adding an argument to the binary like -support-unexpected-elements could be used to insert an array of interface{} on each generated struct with the any struct tag. This could allow the caller to check it at runtime and used to notify support of the need to scan files containing unexpected elements and regenerate structs.

@twpayne
Copy link
Owner

twpayne commented Nov 17, 2023

This is a great observation and would be a really nice improvement to this project. Would you like to work on this?

@cbrow111
Copy link
Author

I'd be happy to.

@twpayne twpayne added the enhancement New feature or request label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants