-
Notifications
You must be signed in to change notification settings - Fork 43
Builder options for specifying the default output kinds #285
Copy link
Copy link
Closed
Labels
indevThe issue is fixed/implemented in the dev branchThe issue is fixed/implemented in the dev branch
Description
On a few projects now, I've been forced to extend DefaultXmlSerializationPolicy just to change the value of defaultPrimitiveOutputKind.
I think it would be a bit nicer to allow users to specify the value of defaultPrimitiveOutputKind and perhaps defaultObjectOutputKind via the builder syntax.
What I write now
val Xml = XML {
policy = XmlPolicy
}
private object XmlPolicy : DefaultXmlSerializationPolicy({
encodeDefault = XmlSerializationPolicy.XmlEncodeDefault.NEVER
}) {
override val defaultPrimitiveOutputKind: OutputKind = OutputKind.Element
}What I would like to write
val Xml = XML {
defaultPolicy {
encodeDefault = XmlSerializationPolicy.XmlEncodeDefault.NEVER
defaultPrimitiveOutputKind = OutputKind.Element
}
}Please let me know if I'm missing something and whether there is already a simpler way of specifying that I want primitives to be encoded as elements by default.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
indevThe issue is fixed/implemented in the dev branchThe issue is fixed/implemented in the dev branch