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 compact serialization of Link, deserialization #48

Closed
xenoterracide opened this issue Mar 20, 2014 · 7 comments
Closed

Support compact serialization of Link, deserialization #48

xenoterracide opened this issue Mar 20, 2014 · 7 comments
Milestone

Comments

@xenoterracide
Copy link

serialization of a Link seems too detailed. I realize that I can write a customer serializer, but I think that the default should be simpler like the uri, rel, title and type, and imho only if the values aren't null, certainly the attached uriBuilder should not have been included in the json output.

"link":{"uri":"http://127.0.0.1:8080/NornLM/activities/d1039a2c-e939-4f84-a790-9d8304fe62d2","uriBuilder":{"host":"127.0.0.1","scheme":"http","port":8080,"userInfo":null,"path":"/NornLM/activities/d1039a2c-e939-4f84-a790-9d8304fe62d2","query":null,"fragment":null,"pathParamNamesInDeclarationOrder":[]},"rel":"item","rels":["item"],"title":null,"params":{"rel":"item"},"type":null}

migrated from jackson-core#135

@cowtowncoder
Copy link
Member

Hmmh. Not quite sure where/how to do this: this is a JAX-RS type, so core jackson-databind can not support it. But perhaps JAX-RS providers could add JAX-RS type support module, if there are other similar types that need special handling.

@cowtowncoder
Copy link
Member

Another thing to note is that Link is for JAX-RS 2.0, not 1.1. Not sure if we can yet drop 1.x support?

@cowtowncoder
Copy link
Member

Ok. Since we are very close to 2.7 release, I will postpone this for Jackson 2.8, to allow for discussion on JAX-RS 2.0. I suspect upgrade is fine, but due to potential compatibility issues do not want to push this quite yet.

I will actually add a skeletal version of datatype module, but will not connect it to be pushed as an artifact.

@cowtowncoder cowtowncoder changed the title better serialization of Link [2.8] Support compact serialization of Link, deserialization Dec 26, 2015
@Dichotomia
Copy link

Any news about this functionality?

@cowtowncoder
Copy link
Member

@Dichotomia I haven't had time to work on this, although I did add datatypes within repository.
If anyone has time to help that'd be great; otherwise I will eventually get to this. 2.8 itself is still at least a month out, but getting this done early would help it be included in the first RC,

@cowtowncoder cowtowncoder modified the milestones: 2,3,, 2.8.0 Jun 3, 2016
@cowtowncoder
Copy link
Member

Datatype module added under datatypes/, Maven coordinates:

  <groupId>com.fasterxml.jackson.datatype</groupId>
  <artifactId>jackson-datatype-jaxrs</artifactId>

and module class name Jaxrs2TypesModule.

Note that for now no attempt is made to auto-register since I don't trust I can ensure all ObjectMapper instances would be configured. But users typically have to choose other datatype modules as well so it should not be big deal.

It would also make sense to see what other JAX-RS 2 datatypes should be supported.

@cowtowncoder cowtowncoder changed the title [2.8] Support compact serialization of Link, deserialization Support compact serialization of Link, deserialization Jun 3, 2016
@Dichotomia
Copy link

Good job!

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

3 participants