-
Notifications
You must be signed in to change notification settings - Fork 769
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
XML Archive Tag Names #395
Comments
Regarding your enumerated points first:
I'm definitely a fan of cleaning up the options interface. It was fine when we had only a few options but it is starting to become very unwieldy, as you demonstrated. I'm not sure I like the interface you propose for the "inner name" of NVP values, though I do like giving this as an option. It might just be the naming I don't like, I'd need to think about it more. If you do decide to make a PR, try to distill each major change into its own independent PR. All of these changes would also need to be mirrored in the JSON archive as well (which you don't have to do), but know that it would be part of merging any of them. |
Hi Azoth, thank you for your kind reply! I have created two pull requests for my two changes:
Hope this is helpful. About JSON, I don't really see a need to touch it, because in JSON the result is already fine as it is:
|
#401 merged |
Closing as #400 is self contained. |
Hello!
So, suppose I have this DTO:
Cereal will serialize it to XML like this:
There are three things I don't like about this XML:
size="dynamic"
attribute. What was it good for, anyway?Therefore, I have forked the repo and added some patches for these issues. Of course, the default behaviour is unchanged, but since I didn't want to add another boolean argument (don't you just love these
Options(true, true, false, true, false)
constructors??), I went for sort of a fluent interface.Now with this code:
My XML looks like this:
So, my additions were:
withInnerName
function to theNameValuePair
to control the name of the inner XML tags.NoSizeAttribute
function to theXMLOutputArchive::Options
class to get rid of the attribute.My branch is currently here. Since I have not so much experience with creating pull requests and having them merged, I'd first like to ask whether this addition is interesting?
Then, since I gather there are already people thinking about a different
Options
structure, maybe it would be nice to have more understandable options, something like this?Options().Precision(4).NoIndent().NoSizeAttributes()
The text was updated successfully, but these errors were encountered: