Search code examples
androidjsonpojo

How to generate PoJo class if we have the JSONobject and JSONarray in the API response?


{
    "CustId": "10705",
    "UserName": "3721",
    "Password": null,
    "AdminPassword": null,
    "CustName": "PB 65 V 3721",
    "CustType": "30",
    "CustKey": "980964ee-2abd-4352-9817-206d7ece8d04",
    "IsSubUser": true,
    "Announcement": "",
    "showIcons": "1111111111",
    "ResponseStatus": {
        "Status": true,
        "ErrorCode": null,
        "StackTrace": null,
        "Message": null,
        "Error": null
    }
}

Solution

  • visit here

    1. Paste your JSON on Left Side.
    2. Then Select type JSON
    3. Annotation style: Gson
    4. getter/setter click on preview/save Zip.

    after your are done, you have to edit a bit to maintain Nested Classes.