05.07.2023, 15:28
I got the JSON string below and like to decode it to date and type per item. How is this done best?
So for example: 2023-01-03 plastic
* string: {"ophaaldagen":{"response":"OK","data":[{"nameType":"plastic","type":"plastic","date":"2023-01-03"},{"nameType":"gft","type":"gft","date":"2023-01-04"},{"nameType":"restafval","type":"restafval","date":"2023-01-11"},{"nameType":"plastic","type":"plastic","date":"2023-01-17"},{"nameType":"gft","type":"gft","date":"2023-01-18"},{"nameType":"gft","type":"gft","date":"2023-01-25"},{"nameType":"plastic","type":"plastic","date":"2023-01-31"},{"nameType":"gft","type":"gft","date":"2023-02-01"},{"nameType":"restafval","type":"restafval","date":"2023-02-08"},{"nameType":"plastic","type":"plastic","date":"2023-02-14"},{"nameType":"gft","type":"gft","date":"2023-02-15"},{"nameType":"gft","type":"gft","date":"2023-02-22"},{"nameType":"plastic","type":"plastic","date":"2023-02-28"},{"nameType":"gft","type":"gft","date":"2023-03-01"},{"nameType":"restafval","type":"restafval","date":"2023-03-08"},{"nameType":"plastic","type":"plastic","date":"2023-03-14"},{"nameType":"gft","type":"gft","date":"2023-03-15"},{"nameType":"gft","type":"gft","date":"2023-03-22"},{"nameType":"plastic","type":"plastic","date":"2023-03-28"},{"nameType":"gft","type":"gft","date":"2023-03-29"},{"nameType":"restafval","type":"restafval","date":"2023-04-05"},{"nameType":"plastic","type":"plastic","date":"2023-04-11"},{"nameType":"gft","type":"gft","date":"2023-04-12"},{"nameType":"gft","type":"gft","date":"2023-04-19"},{"nameType":"plastic","type":"plastic","date":"2023-04-25"},{"nameType":"gft","type":"gft","date":"2023-04-26"},{"nameType":"restafval","type":"restafval","date":"2023-05-03"},{"nameType":"plastic","type":"plastic","date":"2023-05-09"},{"nameType":"gft","type":"gft","date":"2023-05-10"},{"nameType":"gft","type":"gft","date":"2023-05-17"},{"nameType":"plastic","type":"plastic","date":"2023-05-23"},{"nameType":"gft","type":"gft","date":"2023-05-24"},{"nameType":"restafval","type":"restafval","date":"2023-05-31"},{"nameType":"plastic","type":"plastic","date":"2023-06-06"},{"nameType":"gft","type":"gft","date":"2023-06-07"},{"nameType":"gft","type":"gft","date":"2023-06-14"},{"nameType":"plastic","type":"plastic","date":"2023-06-20"},{"nameType":"gft","type":"gft","date":"2023-06-21"},{"nameType":"restafval","type":"restafval","date":"2023-06-28"},{"nameType":"plastic","type":"plastic","date":"2023-07-04"},{"nameType":"gft","type":"gft","date":"2023-07-05"},{"nameType":"gft","type":"gft","date":"2023-07-12"},{"nameType":"plastic","type":"plastic","date":"2023-07-18"},{"nameType":"gft","type":"gft","date":"2023-07-19"},{"nameType":"restafval","type":"restafval","date":"2023-07-26"},{"nameType":"plastic","type":"plastic","date":"2023-08-01"},{"nameType":"gft","type":"gft","date":"2023-08-02"},{"nameType":"gft","type":"gft","date":"2023-08-09"},{"nameType":"plastic","type":"plastic","date":"2023-08-15"},{"nameType":"gft","type":"gft","date":"2023-08-16"},{"nameType":"restafval","type":"restafval","date":"2023-08-23"},{"nameType":"plastic","type":"plastic","date":"2023-08-29"},{"nameType":"gft","type":"gft","date":"2023-08-30"},{"nameType":"gft","type":"gft","date":"2023-09-06"},{"nameType":"plastic","type":"plastic","date":"2023-09-12"},{"nameType":"gft","type":"gft","date":"2023-09-13"},{"nameType":"restafval","type":"restafval","date":"2023-09-20"},{"nameType":"plastic","type":"plastic","date":"2023-09-26"},{"nameType":"gft","type":"gft","date":"2023-09-27"},{"nameType":"gft","type":"gft","date":"2023-10-04"},{"nameType":"plastic","type":"plastic","date":"2023-10-10"},{"nameType":"gft","type":"gft","date":"2023-10-11"},{"nameType":"restafval","type":"restafval","date":"2023-10-18"},{"nameType":"plastic","type":"plastic","date":"2023-10-24"},{"nameType":"gft","type":"gft","date":"2023-10-25"},{"nameType":"gft","type":"gft","date":"2023-11-01"},{"nameType":"plastic","type":"plastic","date":"2023-11-07"},{"nameType":"gft","type":"gft","date":"2023-11-08"},{"nameType":"restafval","type":"restafval","date":"2023-11-15"},{"nameType":"plastic","type":"plastic","date":"2023-11-21"},{"nameType":"gft","type":"gft","date":"2023-11-22"},{"nameType":"gft","type":"gft","date":"2023-11-29"},{"nameType":"plastic","type":"plastic","date":"2023-12-05"},{"nameType":"gft","type":"gft","date":"2023-12-06"},{"nameType":"restafval","type":"restafval","date":"2023-12-13"},{"nameType":"plastic","type":"plastic","date":"2023-12-19"},{"nameType":"gft","type":"gft","date":"2023-12-20"},{"nameType":"gft","type":"gft","date":"2023-12-27"}],"error":false},"ophaaldagenNext":{"response":"NOK","data":[],"error":"No data"}}
So for example: 2023-01-03 plastic
* string: {"ophaaldagen":{"response":"OK","data":[{"nameType":"plastic","type":"plastic","date":"2023-01-03"},{"nameType":"gft","type":"gft","date":"2023-01-04"},{"nameType":"restafval","type":"restafval","date":"2023-01-11"},{"nameType":"plastic","type":"plastic","date":"2023-01-17"},{"nameType":"gft","type":"gft","date":"2023-01-18"},{"nameType":"gft","type":"gft","date":"2023-01-25"},{"nameType":"plastic","type":"plastic","date":"2023-01-31"},{"nameType":"gft","type":"gft","date":"2023-02-01"},{"nameType":"restafval","type":"restafval","date":"2023-02-08"},{"nameType":"plastic","type":"plastic","date":"2023-02-14"},{"nameType":"gft","type":"gft","date":"2023-02-15"},{"nameType":"gft","type":"gft","date":"2023-02-22"},{"nameType":"plastic","type":"plastic","date":"2023-02-28"},{"nameType":"gft","type":"gft","date":"2023-03-01"},{"nameType":"restafval","type":"restafval","date":"2023-03-08"},{"nameType":"plastic","type":"plastic","date":"2023-03-14"},{"nameType":"gft","type":"gft","date":"2023-03-15"},{"nameType":"gft","type":"gft","date":"2023-03-22"},{"nameType":"plastic","type":"plastic","date":"2023-03-28"},{"nameType":"gft","type":"gft","date":"2023-03-29"},{"nameType":"restafval","type":"restafval","date":"2023-04-05"},{"nameType":"plastic","type":"plastic","date":"2023-04-11"},{"nameType":"gft","type":"gft","date":"2023-04-12"},{"nameType":"gft","type":"gft","date":"2023-04-19"},{"nameType":"plastic","type":"plastic","date":"2023-04-25"},{"nameType":"gft","type":"gft","date":"2023-04-26"},{"nameType":"restafval","type":"restafval","date":"2023-05-03"},{"nameType":"plastic","type":"plastic","date":"2023-05-09"},{"nameType":"gft","type":"gft","date":"2023-05-10"},{"nameType":"gft","type":"gft","date":"2023-05-17"},{"nameType":"plastic","type":"plastic","date":"2023-05-23"},{"nameType":"gft","type":"gft","date":"2023-05-24"},{"nameType":"restafval","type":"restafval","date":"2023-05-31"},{"nameType":"plastic","type":"plastic","date":"2023-06-06"},{"nameType":"gft","type":"gft","date":"2023-06-07"},{"nameType":"gft","type":"gft","date":"2023-06-14"},{"nameType":"plastic","type":"plastic","date":"2023-06-20"},{"nameType":"gft","type":"gft","date":"2023-06-21"},{"nameType":"restafval","type":"restafval","date":"2023-06-28"},{"nameType":"plastic","type":"plastic","date":"2023-07-04"},{"nameType":"gft","type":"gft","date":"2023-07-05"},{"nameType":"gft","type":"gft","date":"2023-07-12"},{"nameType":"plastic","type":"plastic","date":"2023-07-18"},{"nameType":"gft","type":"gft","date":"2023-07-19"},{"nameType":"restafval","type":"restafval","date":"2023-07-26"},{"nameType":"plastic","type":"plastic","date":"2023-08-01"},{"nameType":"gft","type":"gft","date":"2023-08-02"},{"nameType":"gft","type":"gft","date":"2023-08-09"},{"nameType":"plastic","type":"plastic","date":"2023-08-15"},{"nameType":"gft","type":"gft","date":"2023-08-16"},{"nameType":"restafval","type":"restafval","date":"2023-08-23"},{"nameType":"plastic","type":"plastic","date":"2023-08-29"},{"nameType":"gft","type":"gft","date":"2023-08-30"},{"nameType":"gft","type":"gft","date":"2023-09-06"},{"nameType":"plastic","type":"plastic","date":"2023-09-12"},{"nameType":"gft","type":"gft","date":"2023-09-13"},{"nameType":"restafval","type":"restafval","date":"2023-09-20"},{"nameType":"plastic","type":"plastic","date":"2023-09-26"},{"nameType":"gft","type":"gft","date":"2023-09-27"},{"nameType":"gft","type":"gft","date":"2023-10-04"},{"nameType":"plastic","type":"plastic","date":"2023-10-10"},{"nameType":"gft","type":"gft","date":"2023-10-11"},{"nameType":"restafval","type":"restafval","date":"2023-10-18"},{"nameType":"plastic","type":"plastic","date":"2023-10-24"},{"nameType":"gft","type":"gft","date":"2023-10-25"},{"nameType":"gft","type":"gft","date":"2023-11-01"},{"nameType":"plastic","type":"plastic","date":"2023-11-07"},{"nameType":"gft","type":"gft","date":"2023-11-08"},{"nameType":"restafval","type":"restafval","date":"2023-11-15"},{"nameType":"plastic","type":"plastic","date":"2023-11-21"},{"nameType":"gft","type":"gft","date":"2023-11-22"},{"nameType":"gft","type":"gft","date":"2023-11-29"},{"nameType":"plastic","type":"plastic","date":"2023-12-05"},{"nameType":"gft","type":"gft","date":"2023-12-06"},{"nameType":"restafval","type":"restafval","date":"2023-12-13"},{"nameType":"plastic","type":"plastic","date":"2023-12-19"},{"nameType":"gft","type":"gft","date":"2023-12-20"},{"nameType":"gft","type":"gft","date":"2023-12-27"}],"error":false},"ophaaldagenNext":{"response":"NOK","data":[],"error":"No data"}}