From 828cbc5cf2c475dcafc1ce03195cf09f466b0037 Mon Sep 17 00:00:00 2001 From: Gavin Hayes Date: Fri, 10 Jan 2025 11:15:11 -0500 Subject: [PATCH] hack: list required nullable properties first before non-required properties Workaround nullable refs not being handled (fixed in #23) --- template/plugin/pdk_types.py.ejs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/template/plugin/pdk_types.py.ejs b/template/plugin/pdk_types.py.ejs index edea53e..2a78c5b 100644 --- a/template/plugin/pdk_types.py.ejs +++ b/template/plugin/pdk_types.py.ejs @@ -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, "# ") %> <% } -%>