Skip to content

Commit

Permalink
hack: list required nullable properties first before non-required pro…
Browse files Browse the repository at this point in the history
…perties

Workaround nullable refs not being handled (fixed in #23)
  • Loading branch information
G4Vi committed Jan 10, 2025
1 parent 8121f34 commit 828cbc5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion template/plugin/pdk_types.py.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ class <%- pythonTypeName(schema.name) %>(JSONWizard):
<% }) %>
<% schema.properties.forEach(p => { -%>
<% if (p.nullable || !p.required) {%>
<% if (p.nullable && p.required) {%>
<% if (p.description) { -%>
# <%- formatCommentBlock(p.description, "# ") %>
<% } -%>
<%- p.name %>: <%- toPythonType(p, p.required) %>
<% } %>
<% }) %>
<% schema.properties.forEach(p => { -%>
<% if (!p.required) {%>
<% if (p.description) { -%>
# <%- formatCommentBlock(p.description, "# ") %>
<% } -%>
Expand Down

0 comments on commit 828cbc5

Please sign in to comment.