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

Support Encoding option when writing XML #636

Closed
4n0nym1ty opened this issue Feb 1, 2024 · 1 comment
Closed

Support Encoding option when writing XML #636

4n0nym1ty opened this issue Feb 1, 2024 · 1 comment

Comments

@4n0nym1ty
Copy link

We used spring boot v3.2.1 , create bean object to convert json to xml and

jackson-dataformat-xml v2.16.1 added as dependency

@bean
public MappingJackson2XmlHttpMessageConverter converter(Jackson2ObjectMapperBuilder builder) {
XmlMapper xmlMapper = builder.createXmlMapper(true).build();
xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true);
xmlMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
return new MappingJackson2XmlHttpMessageConverter(xmlMapper);
}

we are able to convert json to xml but we are missing encoding xml version []

@pjfanning
Copy link
Member

duplicate of #315

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants