jasminb / jsonapi-converter

JSONAPI-Converter is a Java/Android library that provides support for working with JSONAPI spec
Apache License 2.0
272 stars 81 forks source link

How to generate this nested JSON (tenor) ? #231

Closed hilmyoctaviano closed 4 years ago

hilmyoctaviano commented 4 years ago
{
    "status": "OK",
    "data": [
        {
            "id": 2,
            "name": "hongkong - shenzhen - macau",
            "slug": "hongkong-shenzhen-macau",
            "partner": "PT Mitra Mega Komunika",
            "image": "xxxxx",
            "price": "Rp. 10,700,000",
            "excerpt": "4 Hari 3 Malam",
            "views": 0,
            "tenor": [
                {
                    "bulan": "1",
                    "cicilan": "Cicilan 12 bulan : Rp. 1,095,946/bulan"
                },
                {
                    "bulan": "2",
                    "cicilan": "Cicilan 18 bulan : Rp. 799,700/bulan"
                },
                {
                    "bulan": "3",
                    "cicilan": "Cicilan 24 bulan : Rp. 655,083/bulan"
                },
                {
                    "bulan": "4",
                    "cicilan": "Cicilan 30 bulan : Rp. 570,369/bulan"
                },
                {
                    "bulan": "5",
                    "cicilan": "Cicilan 36 bulan : Rp. 515,910/bulan"
                },
                {
                    "bulan": "6",
                    "cicilan": "Cicilan 42 bulan : Rp. 478,021/bulan"
                },
                {
                    "bulan": "7",
                    "cicilan": "Cicilan 48 bulan : Rp. 451,285/bulan"
                }
            ]
        }
    ]
}

Can you help me on how to build this tenor field?

hilmyoctaviano commented 4 years ago

I already solve this issue using List<Map<String, String>>