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

Add support for Enum with interfaces #20

Closed
MathieuLorber opened this issue Jun 11, 2014 · 9 comments
Closed

Add support for Enum with interfaces #20

MathieuLorber opened this issue Jun 11, 2014 · 9 comments
Assignees
Milestone

Comments

@MathieuLorber
Copy link

I'm currently working on a big GWT project, and more precisely on a proof of concept to use JSON with Jackson on the server side, gwt-jackson on the front size. The RPC services we try to migrate use complex objects. I tried several libraries, gwt-jackson is the only one to purpose solutions for some difficulties (inheritance with generics, complex map keys...).

But I actually have problems with some enums, which have the particularity to implement interfaces. The current serializer/deserializer for enums are ok with plain simple enums, but do not permit the use of interfaces with JsonTypeInfo annotation, and enums implementing them. I don't think that's a heavy feature, but it would be a great one here =)

@nmorel
Copy link
Owner

nmorel commented Jun 11, 2014

Can you give me an example of what you are trying to do please ?

@nmorel nmorel added this to the 0.6.0 milestone Jun 11, 2014
@nmorel nmorel self-assigned this Jun 11, 2014
@MathieuLorber
Copy link
Author

You'll find a example in my fork : https://github.com/MathieuLorber/gwt-jackson , project examples/hello (sorry for the formatting...)

nmorel added a commit that referenced this issue Jun 11, 2014
@nmorel
Copy link
Owner

nmorel commented Jun 11, 2014

First observations :

  • Subtype(De)Serializer only expect AbstractBeanJson(De)Serializer. So it fails when we try to add an EnumJson(De)Serializer.
  • Jackson uses As.WRAPPER_ARRAY for enums even if specified otherwise.

@nmorel
Copy link
Owner

nmorel commented Jun 11, 2014

Serialization is now working. I'm gonna try to finish deserialization by tomorrow.

@nmorel
Copy link
Owner

nmorel commented Jun 11, 2014

Well, tomorrow might be now. Jenkins is building the branch. If everything is ok, you will have a snapshot 0.5.1-SNAPSHOT available with the fix soon.

@nmorel
Copy link
Owner

nmorel commented Jun 11, 2014

Snapshot available

@MathieuLorber
Copy link
Author

Well it works on my simple sample, I'll try tomorrow on the true-life-project... Thank you for your reactivity !

@MathieuLorber
Copy link
Author

It's ok on my larger project =)
(sorry for the response time, I had others problems related to the refactor)

@nmorel
Copy link
Owner

nmorel commented Jun 18, 2014

Ok good news :)
I'll see when I make a new release. I would like to include mix-in annotation support in it.

@nmorel nmorel closed this as completed Jun 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants