apache / apache/curator

[CURATOR-5] Make JsonInstanceSerializer#deserialize leverage ServiceInstanceBuilder

Open
#526 2 comments 0 reactions 0 assignees View on GitHub
imported-jira-issue rfe
Dominant language
Java
Stars
3.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

From https://github.com/Netflix/curator/pull/255

Proposing a way to change JsonInstanceSerializer leverage ServiceInstance's builder pattern directly.

See discussion and request to generate a patch here: https://groups.google.com/d/topic/curator-users/Ai9RsVoUdgU/discussion

===

It's possible a lot of the lower-level JSON deserialization code in JsonInstanceSerializer#deserialize() could be passed off to Jackson if ServiceInstanceBuilder's setters also followed the bean patterns (e.g. setId() versus id()). If ServiceInstanceBuilder followed this pattern, Jackson's standard bean deserialization could, I believe, deserialize directly into the ServiceInstanceBuilder and JsonInstanceSerializer#deserialize() could use that higher-level pattern to eliminate a fair chunk of code here.

===

So, why don't we make ServiceInstanceBuilder follow the bean API? Can you update this pull to reflect that? I suggest leaving the old builder-style methods and marking them as deprecated. This way it won't break existing users.

---
Originally reported by randgalt, imported from: Make JsonInstanceSerializer#deserialize leverage ServiceInstanceBuilder


  • status: Open
  • priority: Minor
  • resolution: Unresolved
  • imported: 2025-01-21

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.