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

JSON Inheritance deserialization complex object #13

Closed
imrabti opened this issue Jan 21, 2014 · 5 comments
Closed

JSON Inheritance deserialization complex object #13

imrabti opened this issue Jan 21, 2014 · 5 comments
Assignees
Milestone

Comments

@imrabti
Copy link

imrabti commented Jan 21, 2014

I'm having some difficulties parsing this JSON data :

{
    "class":"com.myproject.common.shared.dispatch.GetResult",
    "exceptionMessage":null,
    "payload":{
        "user":{
            "class":"com.myproject.common.shared.business.identity.User",
            "id":3,
            "username":"admin",
            "email":"admin@arcbees.com",
            "password":"Test1234",
            "firstName":"Admin",
            "lastName":"Admin",
            "authority":["ROLE_ADMIN","ROLE_USER"]
        },
        "customeUI":{
            "id":1,
            "headerBackgroundColor":"#00699B",
            "headerFontColor":"#ffffff",
            "headerFontHoverColor":"rgb(190, 190, 190)",
            "siderBackgroundColor":"#191919",
            "siderSelectedMenuColor":"#ffffff",
            "siderHoverMenuColor":"#111",
            "siderFontColor":"#ffffff",
            "siderSelectFontColor":"#333",
            "siderMenuBorderTop":"#212121",
            "siderMenuBorderBottom":"#0a0c0e",
            "siderMenuHoverBorderLeft":"#111"
        }
    }
}

Can't deserialize the user property.

The "com.myproject.common.shared.business.identity.User" class is a parent class and have a child class "com.myproject.common.shared.business.identity.BackUser".

@nmorel
Copy link
Owner

nmorel commented Jan 21, 2014

Can you also give the User and BackUser class please ? To see the annotations you put on them.

@ghost ghost assigned nmorel Jan 21, 2014
@nmorel
Copy link
Owner

nmorel commented Jan 21, 2014

Does one of your class mix generics + inheritance ? It's not working from the test I just did.

nmorel added a commit that referenced this issue Jan 21, 2014
There was a compilation problem when adding the subtype (de)serializer to the map
+ no parameter (de)serializer was given to the subtype (de)serializer constructor
@nmorel
Copy link
Owner

nmorel commented Jan 21, 2014

I fixed one of the issue I found. If you still have a problem with the snapshot, tell me.

@imrabti
Copy link
Author

imrabti commented Jan 21, 2014

Yes The GetResult is a generic object which will wrap the content of the response and add to it some metadata.
I'll test with the snapshot and update the status of the issue.

@nmorel
Copy link
Owner

nmorel commented Jan 24, 2014

Were you able to test the snapshot ?

@nmorel nmorel modified the milestones: 0.5.0, 0.4.1 Mar 26, 2014
@nmorel nmorel closed this as completed Mar 28, 2014
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

2 participants