SEBA-513 Tosca engine should not require fields with Default set
Change-Id: Ic24522bc2924aa6d8f26c356a66865d173399938
diff --git a/lib/xos-genx/xosgenx/jinja2_extensions/tosca.py b/lib/xos-genx/xosgenx/jinja2_extensions/tosca.py
index 4424824..b6ae85d 100644
--- a/lib/xos-genx/xosgenx/jinja2_extensions/tosca.py
+++ b/lib/xos-genx/xosgenx/jinja2_extensions/tosca.py
@@ -16,10 +16,10 @@
from xosgenx.jinja2_extensions import xproto_field_graph_components
-def xproto_tosca_required(null, blank, default=None):
-
- if null == "True" or blank == "True" or default != "False":
- return "false"
+def xproto_tosca_required(null, blank, default=None, modifier=None):
+ # `null` is not currently considered. `blank` is deprecated.
+ if (modifier == "optional") or (blank == "True") or (default is not None):
+ return "false"
return "true"