diff --git a/src/target/python_class.rs b/src/target/python_class.rs index a242022..b647d45 100644 --- a/src/target/python_class.rs +++ b/src/target/python_class.rs @@ -146,8 +146,11 @@ fn write_output( ); } } - Type::Array(_) => { + Type::Array(inner) => { imports_from_typing.insert("List"); + if schema.arena.get(inner).unwrap().is_any() { + imports_from_typing.insert("Any"); + } } _ => {} } diff --git a/src/target/python_inline.rs b/src/target/python_inline.rs index 02f91da..9219407 100644 --- a/src/target/python_inline.rs +++ b/src/target/python_inline.rs @@ -139,8 +139,11 @@ fn write_output( }); } } - Type::Array(_) => { + Type::Array(inner) => { imports_from_typing.insert("List"); + if schema.arena.get(inner).unwrap().is_any() { + imports_from_typing.insert("Any"); + } } _ => {} }