[SEBA-543] Fixing the modeldef API to report required fields

Change-Id: Ia677765e3de10941f6e7ecec15fa85175bc9c0db
diff --git a/lib/xos-genx/xosgenx/jinja2_extensions/gui.py b/lib/xos-genx/xosgenx/jinja2_extensions/gui.py
index a48d95a..476548b 100644
--- a/lib/xos-genx/xosgenx/jinja2_extensions/gui.py
+++ b/lib/xos-genx/xosgenx/jinja2_extensions/gui.py
@@ -64,6 +64,7 @@
 
 
 def xproto_validators(f):
+
     # To be cleaned up when we formalize validation in xproto
     validators = []
 
@@ -92,7 +93,7 @@
 
     # required validator
     try:
-        required = f["options"]["blank"] == "False" and f["options"]["null"] == "False"
+        required = f["modifier"] == "required"
         if required:
             validators.append({"name": "required", "bool_value": required})
     except KeyError: