Closed Gowee closed 1 year ago
Currently, types from typing are only imported for those who are direct children of Maps. We need to check the inner of List as well.
typing
Map
List
Relevant code: https://github.com/Gowee/json2pyi/blob/1955a93db98e1059a39d86143a7cf65106409715/src/target/python_class.rs#L98
Sample JSON to reproduce:
{ "page": { "id": "kctbh9vrtdwd", "name": "GitHub", "url": "https://www.githubstatus.com", "time_zone": "Etc/UTC", "updated_at": "2020-12-03T08:11:21.385Z" }, "components": [ { "id": "8l4ygp009s5s", "name": "Git Operations", "status": "operational", "created_at": "2017-01-31T20:05:05.370Z", "updated_at": "2020-10-29T22:51:43.831Z", "position": 1, "description": "Performance of git clones, pulls, pushes, and associated operations", "showcase": false, "start_date": null, "group_id": null, "page_id": "kctbh9vrtdwd", "group": false, "only_show_if_degraded": false } ], "incidents": [], "scheduled_maintenances": [], "status": { "indicator": "none", "description": "All Systems Operational" } }
Currently, types from
typing
are only imported for those who are direct children ofMap
s. We need to check the inner ofList
as well.Relevant code: https://github.com/Gowee/json2pyi/blob/1955a93db98e1059a39d86143a7cf65106409715/src/target/python_class.rs#L98
Sample JSON to reproduce: