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

feat: enhance TypeManager to support multiple serialization contexts #1586

Merged

Conversation

juliapampus
Copy link
Contributor

What this PR changes/adds

Adds methods to register custom ObjectMappers and serialization contexts by type.

Why it does that

Provide the possibility to support de/serialization of multiple contexts.

Further notes

See decision record in #1582. Example will be provided with adding an IDS context (see #1541).

Linked Issue(s)

Closes #1581

Checklist

  • added appropriate tests?
  • performed checkstyle check locally?
  • added/updated copyright headers?
  • documented public classes/methods?
  • added/updated relevant documentation?
  • added relevant details to the changelog? (skip with label no-changelog)
  • formatted title correctly? (take a look at the CONTRIBUTING and styleguide for details)

@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2022

Codecov Report

Merging #1586 (09636d8) into main (80c2d81) will decrease coverage by 0.01%.
The diff coverage is 65.38%.

@@            Coverage Diff             @@
##             main    #1586      +/-   ##
==========================================
- Coverage   67.79%   67.77%   -0.02%     
==========================================
  Files         759      759              
  Lines       16386    16401      +15     
  Branches     1049     1049              
==========================================
+ Hits        11109    11116       +7     
- Misses       4798     4806       +8     
  Partials      479      479              
Impacted Files Coverage Δ
...ipse/dataspaceconnector/spi/types/TypeManager.java 43.47% <65.38%> (+1.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80c2d81...09636d8. Read the comment docs.

@juliapampus juliapampus force-pushed the feat/enhance_type_manager branch from 13097e3 to 833bef1 Compare July 4, 2022 13:41
@juliapampus juliapampus merged commit 8aec85b into eclipse-edc:main Jul 5, 2022
@juliapampus juliapampus deleted the feat/enhance_type_manager branch July 5, 2022 07:40
@Test
void verifySerialization() throws JsonProcessingException {
var manager = new TypeManager();
manager.registerSerializer("foo", Bar.class, new JsonSerializer<>() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm late to the party but this test should be more strict as it succeed also if the serializer is not registered.

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

Successfully merging this pull request may close these issues.

Support configuration of multiple serialization contexts
5 participants