Classgen: forward item types for array types
This commit is contained in:
@@ -36,4 +36,4 @@ class Inventory:
|
||||
meta: Meta
|
||||
machines: dict[str, Machine] = 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)
|
||||
return res
|
||||
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":
|
||||
return {"str"}
|
||||
if json_type == "integer":
|
||||
|
||||
Reference in New Issue
Block a user