@@ -375,7 +375,8 @@ def __default__(self, data, children, meta):
375375 return (data , child )
376376
377377 # Handle keyword rules (no children) - return (name, True)
378- if not children :
378+ # But not for _fields rules which may legitimately be empty
379+ if not children and not data .endswith ("_fields" ):
379380 return (data , True )
380381
381382 # Handle block rules (e.g., options_block, dimensions_block)
@@ -405,12 +406,16 @@ def __default__(self, data, children, meta):
405406 elif isinstance (item , tuple ):
406407 field_tuples .append (item )
407408
408- # For binding blocks (models, exchanges, solutiongroup), return just the
409- # records list. The _block handler will wrap it as {block_name: list},
410- # which is what the converter expects for binding resolution .
409+ # For binding blocks (models, exchanges, solutiongroup), always return
410+ # a list (possibly empty) . The _block handler will wrap it as
411+ # {block_name: list}, which is what the converter expects.
411412 # Note: solutiongroup has mxiter, but we ignore it here since the
412413 # Simulation class doesn't have a place for it yet.
413- if records and (not field_tuples or block_name == "solutiongroup" ):
414+ if block_name in ("models" , "exchanges" , "solutiongroup" ):
415+ return records
416+
417+ # For other blocks with only records (no scalar fields), return list
418+ if records and not field_tuples :
414419 return records
415420
416421 # Build result dict from scalar fields
0 commit comments