API services : Comment_List -> ":" in var name comments:post

Pierre Lm Posted in Component Development 4 years ago

I have a problem with the comments_list function.
I didn't found any documentation about it, but it's not the problem.

The path comments_list return a var named "comments:post" an the ":" cannot be serialized for varname :

{
    "merchant": "Mon r\u00e9seau priv\u00e9",
    "url": "http:\/\/myDomain.fr\/ossn\/",
    "time_token": 1603107342,
    "payload": {
        "count": 1,
        "comments": [
            {
                "id": 8,
                "time_created": 1602787740,
                "owner_guid": 1,
                "subject_guid": 5128,
                "type": "comments:post",
                "comments:post": "voici mon commentaire",
                "user": {
                    "guid": 1,
                    "first_name": "jhon",
                    "last_name": "doe",
                    "fullname": "Jhon Doe",
                    "username": "J1243",
                    "email": "[email protected]",
                    "birthdate": "17\/02\/1901",
                    "gender": "male",
                    "icon": {
                        "topbar": "http:\/\/myDomain.fr\/ossn\/avatar\/pierre\/topbar\/c72da28711d28a7047d769edd8e451a3.jpeg",
                        "smaller": "http:\/\/myDomain.fr\/ossn\/avatar\/pierre\/smaller\/35dcc729b09a47e49d9918dacbd2a4a3.jpeg",
                        "small": "http:\/\/myDomain.fr\/ossn\/avatar\/pierre\/small\/9fbbe98180e9621ce93e97c724ae8f4f.jpeg",
                        "larger": "http:\/\/myDomain.fr\/ossn\/avatar\/pierre\/larger\/9b91ab16e88e414a2e3383672a20a4ac.jpeg",
                        "large": "http:\/\/myDomain.fr\/ossn\/avatar\/pierre\/large\/a1d743d6c31b7d3d40e91d2472b1e235.jpeg"
                    },
                    "cover_url": "http:\/\/myDomain.fr\/ossn\/cover\/pierre\/78427b619d00406c0039986ad90b78bd.jpg",
                    "language": "en"
                },
                "total_likes": 1,
                "is_liked_by_user": true
            }
        ],
        "offset": "1"
    },
    "code": "100",
    "message": "Request successfully executed"

.

Replies
French Pierre Lm Replied 4 years ago

Hi, I solved my problem in using annotation :

@SerializedName("comments:post")
private String commentsPost;

Thank you Arsalan.

French Pierre Lm Replied 4 years ago

I use java for Android dev with retrofit.

Indonesian Arsalan Shah Replied 4 years ago

What programming language you using to obtain API data?