Skip to content

Add configured XmlEncoder to allow encoding without prolog #15

Merged
merged 2 commits into from
Feb 7, 2020

Conversation

valentiay
Copy link
Contributor

This PR add ability to configure XmlEncoder. At the moment only configuring prolog is implemented, buy config is free for extention.

For example,

@XmlCodec("Foo")
final case class Foo(a: Int, b: String, c: Double)

val foo = Foo(1, "abc", 1.0)

XmlEncoder[Foo].encodeWithConfig(foo, XmlEncoder.defaultConfig.withoutProlog)

will result to

<Foo><a>1</a><b>abc</b><c>1.0</c></Foo>

instead of default

<?xml version='1.0' encoding='UTF-8'?>
<Foo><a>1</a><b>abc</b><c>1.0</c></Foo>

@valentiay valentiay merged commit a287235 into master Feb 7, 2020
@valentiay valentiay deleted the ConfiguredEncoder branch March 10, 2021 14:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant