Hi Is there any way to map dynamic keys? I have this piece of json, in which keys varies, i used to ...
j
Hi Is there any way to map dynamic keys? I have this piece of json, in which keys varies, i used to make use of groovy to parse those keys bug now we are moving to ktor.
Copy code
flights_information": {
                "OD_CUNMIA_01_20221111": {
                    "CPA_1": {
                        "FL00GH8001": {
                            "arrival_information": {
                                "airport_reference_id": "MIA_0",
                                "change_day_indicator": "0",
                                "date": "2022-11-11",
                                "date_of_week_name": "Friday",
                                "time": "17:30:00"
                            },
e
a
Map<String, ...>
?
j
i have thought about that but i’m afraid i would need nested maps and it would be difficult to handle
c
well, depends on exactly how the key varies. if it's one of only a few options, you can use JsonNames on the property
if it's literally anything, then map is your best call