Skip to content

Commit 60242c8

Browse files
authored
Merge pull request #9 from dylibso/required-vs-nullable
Support nullable vs required
2 parents 65d8cbb + 0e3a0c1 commit 60242c8

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

package-lock.json

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"typescript": "^5.3.2"
1818
},
1919
"dependencies": {
20-
"@dylibso/xtp-bindgen": "1.0.0-rc.8",
20+
"@dylibso/xtp-bindgen": "1.0.0-rc.11",
2121
"ejs": "^3.1.10"
2222
}
2323
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function toPythonType(property: Property): string {
5555
}
5656

5757
if (!tp) throw new Error("Cant convert property to Python type: " + property.type)
58-
if (!property.nullable) return tp
58+
if (!property.nullable && !property.required) return tp
5959
return `Optional[${tp}]`
6060
}
6161

0 commit comments

Comments
 (0)