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

How to serialize specific list in a position? #69

Open
alouanemed opened this issue Sep 22, 2018 · 1 comment
Open

How to serialize specific list in a position? #69

alouanemed opened this issue Sep 22, 2018 · 1 comment

Comments

@alouanemed
Copy link

I am using this adapter with the wrapped annotation. But I have difficulty on serializing a specific list item inside another list (categories). You will find the json below with the needed list commented.

API service :

@GET("venues/categories") @Wrapped(path = { "response", "categories" })

Json file:


{
    "meta": {
        "code": 200,
        "requestId": "5ba633244c1f670803edce43"
    },
    "response": {
        "categories": [
             {},
             {},
             {},   
               {
                "id": "4d4b7105d754a06374d81259",
                "name": "Food",
                "pluralName": "Food",
                "shortName": "Food",
                "icon": {
                    "prefix": "https://ss3.4sqi.net/img/categories_v2/food/default_",
                    "suffix": ".png"
                },
                "categories": [ //want to serialize this
                    {
                        "id": "503288ae91d4c4b30a586d67",
                        "name": "Afghan Restaurant",
                      ...





Thanks.

@serj-lotutovici
Copy link
Owner

In this case, I would recommend writing your own json adapter. The @Wrapped adapter only works for simple wrapped objects.

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