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

Fix #678: allow configuring custom SerializerFactory via JacksonXmlModule #680

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

cowtowncoder
Copy link
Member

@cowtowncoder cowtowncoder commented Oct 29, 2024

Implements a feature to address #678.

@cowtowncoder cowtowncoder self-assigned this Oct 29, 2024
@cowtowncoder cowtowncoder added the 2.18 Issues planned at earliest for 2.18 label Oct 29, 2024
@cowtowncoder
Copy link
Member Author

@SimonCockx Ok so I don't think there is (alas!) any way to fix obvious handling to allow direct setting via ObjectMapper -- but it seems straight-forward to add functionality to pass SerializerFactory as module configuration like so:

ObjectMapper mapper = XmlMapper.builder()
    .addModule(new JacksonXmlModule().overrideSerializerFactory(RosettaSerialiserFactory.INSTANCE))
    .build();

which should then set SerializerFactory before module registration.

This PR is for adding that functionality, although in the meantime your work-around seems legit (if non-obvious).

LMK what do you think. Addition would go in 2.18.2 which is some way off as I just released 2.18.1 earlier today.

@cowtowncoder
Copy link
Member Author

I think this makes sense, will merge.

@cowtowncoder cowtowncoder merged commit 5b78983 into 2.18 Nov 4, 2024
4 checks passed
@cowtowncoder cowtowncoder deleted the tatu/2.18/678-custom-serializer-factory branch November 4, 2024 01:50
@SimonCockx
Copy link
Contributor

@cowtowncoder I completely missed this, sorry. Thanks for the PR, it looks good!

@cowtowncoder
Copy link
Member Author

No problem, figured there's not much downside so could merge it. But will take a while to be available -- I did add it in 2.18 (minor deviation from SemVer), but since 2.18.1 was just released 2.18.2 won't be immediate, will be a month or two, likely.

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

Successfully merging this pull request may close these issues.

2 participants