Skip to content

Commit 58f955c

Browse files
author
zach
committed
wip
1 parent a5cd721 commit 58f955c

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

bindgen-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ case $1 in
2929
# Using ../../bundle so we test the bindgen template
3030
PLUGIN_NAME=exampleplugin
3131
echo "generating initial plugin code in '$(pwd)/$PLUGIN_NAME'..."
32-
xtp plugin init --schema-file schema.yaml --template ../../bundle --path $PLUGIN_NAME --name $PLUGIN_NAME --feature stub-with-code-samples
32+
# xtp plugin init --schema-file schema.yaml --template ../../bundle --path $PLUGIN_NAME --name $PLUGIN_NAME --feature stub-with-code-samples
3333
echo "building '$PLUGIN_NAME'..."
3434
xtp plugin build --path $PLUGIN_NAME
3535
echo "testing '$PLUGIN_NAME'..."

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ function toPythonType(property: Property): string {
3131
case "object":
3232
return "dict";
3333
case "array":
34-
return "list";
34+
if (!property.items) return "list";
35+
return `List[${toPythonType(property.items as Property)}]`;
3536
case "buffer":
3637
return "bytes";
3738
default:

template/plugin/pdk_types.py.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# THIS FILE WAS GENERATED BY `xtp-python-bindgen`. DO NOT EDIT.
22

33
from enum import Enum # noqa: F401
4-
from typing import Optional # noqa: F401
4+
from typing import Optional, List # noqa: F401
55
from datetime import datetime # noqa: F401
66
from dataclasses import dataclass # noqa: F401
77

0 commit comments

Comments
 (0)