https://github.com/phalt/clientele/blob/main/clientele/generators/standard/utils.py#L148-L150
elif t_type == DataType.ARRAY:
print(t, t_type, t.get("items"))
inner_class = get_type(t.get("items"))
base_type = f"list[{inner_class}]"
For array without items property:
{'type': 'array', 'items': {'type': 'number'}} array {'type': 'number'}
{'type': 'array'} array None
it throw an error:
File "...\.venv\Lib\site-packages\clientele\generators\standard\utils.py", line 150, in get_type
inner_class = get_type(t.get("items"))
File "...\.venv\Lib\site-packages\clientele\generators\standard\utils.py", line 100, in get_type
t_type = t.get("type")
^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
one posible solution is set inner_class to typing.Any when t.get("items") is None
elif t_type == DataType.ARRAY:
inner_class = get_type(t.get("items")) if t.get("items") else "typing.Any"
base_type = f"list[{inner_class}]"
https://github.com/phalt/clientele/blob/main/clientele/generators/standard/utils.py#L148-L150
For array without items property:
it throw an error:
one posible solution is set inner_class to
typing.Anywhent.get("items")is None