Skip to content

Commit b76cae3

Browse files
committed
hack: list required nullable properties first before non-required properties
Workaround nullable refs not being handled (fixed in #23)
1 parent 8121f34 commit b76cae3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

template/plugin/pdk_types.py.ejs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,16 @@ class <%- pythonTypeName(schema.name) %>(JSONWizard):
2828
<% }) %>
2929
3030
<% schema.properties.forEach(p => { -%>
31-
<% if (p.nullable || !p.required) {%>
31+
<% if (p.nullable && p.required) {%>
32+
<% if (p.description) { -%>
33+
# <%- formatCommentBlock(p.description, "# ") %>
34+
<% } -%>
35+
<%- p.name %>: <%- toPythonType(p, p.required) %>
36+
<% } %>
37+
<% }) %>
38+
39+
<% schema.properties.forEach(p => { -%>
40+
<% if (!p.required) {%>
3241
<% if (p.description) { -%>
3342
# <%- formatCommentBlock(p.description, "# ") %>
3443
<% } -%>

0 commit comments

Comments
 (0)