Thais is my json format
"recommended": {
"section_title": "Recommended",
"section_sub_title": "Recommended",
"data": {
"Allahabad": [
{
"gym_id": "9",
"name": "raga fitness",
"address": "35 Vivekanand Marg Hewett Road Allahabad",
"city_id": "1565",
"gym_logo": "http://139.180.218.66/gym/resources/alias_raga_fitness_20220403165957.jpeg",
"no_of_ratings": null,
"total_ratings": null,
"average_ratings": null,
"city_name": "Allahabad"
}
],
"Lucknow": [
{
"gym_id": "2",
"name": "Gym Name 2",
"address": "gym address",
"city_id": "1496",
"gym_logo": "http://139.180.218.66/gym/resources/alias_Gym_Name_20220127182703.jpeg",
"no_of_ratings": "16",
"total_ratings": "55.5",
"average_ratings": "3.5",
"city_name": "Lucknow"
}
]
}
}
i use json_serializable, dio, and json_annotation want to be mapped with modal and ResponseMapper
I am using json_serializable in Flutter to store a class in a file and read back from it. I am not posting the original class here for simplicity, but the principle is that half way through writing the app I decided that I wanted to change the variable name "aStupidName" to "name". How can I advise the code generation utility to assign the JSON value with the key "aStupidName", if it exists in the JSON, to the variable "name", but if the key "name" exists to assign this to the variable instead, i.e. in newer versions of the file?