Classgen: forward item types for array types
This commit is contained in:
@@ -36,4 +36,4 @@ class Inventory:
|
|||||||
meta: Meta
|
meta: Meta
|
||||||
machines: dict[str, Machine] = field(default_factory = dict)
|
machines: dict[str, Machine] = field(default_factory = dict)
|
||||||
services: dict[str, Service] = field(default_factory = dict)
|
services: dict[str, Service] = field(default_factory = dict)
|
||||||
tags: dict[str, list[Any]] = field(default_factory = dict)
|
tags: dict[str, list[str]] = field(default_factory = dict)
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ def map_json_type(
|
|||||||
res |= map_json_type(t)
|
res |= map_json_type(t)
|
||||||
return res
|
return res
|
||||||
if isinstance(json_type, dict):
|
if isinstance(json_type, dict):
|
||||||
return map_json_type(json_type.get("type"))
|
items = json_type.get("items")
|
||||||
|
if items:
|
||||||
|
nested_types = map_json_type(items)
|
||||||
|
return map_json_type(json_type.get("type"), nested_types)
|
||||||
if json_type == "string":
|
if json_type == "string":
|
||||||
return {"str"}
|
return {"str"}
|
||||||
if json_type == "integer":
|
if json_type == "integer":
|
||||||
|
|||||||
Reference in New Issue
Block a user