@@ -1668,7 +1668,7 @@ def from_etree(entity_type_property_node):
1668
1668
return StructTypeProperty (
1669
1669
entity_type_property_node .get ('Name' ),
1670
1670
Types .parse_type_name (entity_type_property_node .get ('Type' )),
1671
- entity_type_property_node . get ( 'Nullable' ),
1671
+ attribute_get_bool ( entity_type_property_node , 'Nullable' , True ),
1672
1672
entity_type_property_node .get ('MaxLength' ),
1673
1673
entity_type_property_node .get ('Precision' ),
1674
1674
entity_type_property_node .get ('Scale' ),
@@ -2364,7 +2364,7 @@ def from_etree(function_import_node, config: Config):
2364
2364
for param in function_import_node .xpath ('edm:Parameter' , namespaces = config .namespaces ):
2365
2365
param_name = param .get ('Name' )
2366
2366
param_type_info = Types .parse_type_name (param .get ('Type' ))
2367
- param_nullable = param . get ( 'Nullable' )
2367
+ param_nullable = attribute_get_bool ( param , 'Nullable' , False )
2368
2368
param_max_length = param .get ('MaxLength' )
2369
2369
param_precision = param .get ('Precision' )
2370
2370
param_scale = param .get ('Scale' )
@@ -2401,8 +2401,7 @@ def sap_attribute_get_string(node, attr):
2401
2401
return sap_attribute_get (node , attr )
2402
2402
2403
2403
2404
- def sap_attribute_get_bool (node , attr , default ):
2405
- value = sap_attribute_get (node , attr )
2404
+ def str_to_bool (value , attr , default ):
2406
2405
if value is None :
2407
2406
return default
2408
2407
@@ -2415,6 +2414,14 @@ def sap_attribute_get_bool(node, attr, default):
2415
2414
raise TypeError ('Not a bool attribute: {0} = {1}' .format (attr , value ))
2416
2415
2417
2416
2417
+ def attribute_get_bool (node , attr , default ):
2418
+ return str_to_bool (node .get (attr ), attr , default )
2419
+
2420
+
2421
+ def sap_attribute_get_bool (node , attr , default ):
2422
+ return str_to_bool (sap_attribute_get (node , attr ), attr , default )
2423
+
2424
+
2418
2425
ANNOTATION_NAMESPACES = {
2419
2426
'edm' : 'http://docs.oasis-open.org/odata/ns/edm' ,
2420
2427
'edmx' : 'http://docs.oasis-open.org/odata/ns/edmx'
0 commit comments