Skip to content

Commit

Permalink
cleanup: only set default values for non-required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Nov 19, 2024
1 parent 4828a02 commit 59738e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions template/plugin/pdk_types.py.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class <%- capitalize(schema.name) %>(extism.Json):
<% if (p.description) { -%>
# <%- formatCommentBlock(p.description, "# ") %>
<% } -%>
<% if (!p.nullable) {%>
<% if (!p.nullable || p.required) {%>
<%- p.name %>: <%- toPythonType(p) %>
<% } %>
<% }) %>
Expand All @@ -30,8 +30,8 @@ class <%- capitalize(schema.name) %>(extism.Json):
<% if (p.description) { -%>
# <%- formatCommentBlock(p.description, "# ") %>
<% } -%>
<% if (p.nullable) {%>
<%- p.name %>: <%- toPythonType(p) %> = None
<% if (p.nullable && !p.required) {%>
<%- p.name %>: <%- toPythonType(p) %>
<% } %>
<% }) %>
Expand Down

0 comments on commit 59738e2

Please sign in to comment.