@@ -263,16 +263,16 @@ def _help_action_print_body_args(
263263 """
264264 console .print (f"[bold]Arguments{ f' ({ title } )' if title else '' } :[/]" )
265265
266- for group in _help_group_arguments (args ):
267- for option in _help_group_options (group ):
268- if option [0 ] is not None :
269- # If this is an option with an explicit title,
270- # display it here
271- console .print (
272- Padding .indent (f"[bold underline]{ option [0 ]} [/]:" , 4 ),
273- )
266+ for option in _help_group_options (args ):
267+ if option [0 ] is not None :
268+ # If this is an option with an explicit title,
269+ # display it here
270+ console .print (
271+ Padding .indent (f"[bold underline]{ option [0 ]} [/]:" , 4 ),
272+ )
274273
275- for arg in option [1 ]:
274+ for group in _help_group_arguments (option [1 ]):
275+ for arg in group :
276276 metadata = []
277277
278278 if op .method in {"post" , "put" } and arg .required :
@@ -309,6 +309,7 @@ def _help_group_arguments(
309309 Returns help page groupings for a list of POST/PUT arguments.
310310 """
311311 args_sorted = sorted (args , key = lambda a : a .path )
312+ arg_parents = set (arg .parent for arg in args_sorted )
312313
313314 groups_tmp = defaultdict (list )
314315
@@ -317,7 +318,12 @@ def _help_group_arguments(
317318 if arg .read_only :
318319 continue
319320
320- groups_tmp [arg .path .split ("." , 1 )[0 ]].append (arg )
321+ group_key = arg .parent
322+
323+ if arg .path in arg_parents :
324+ group_key = arg .path
325+
326+ groups_tmp [group_key ].append (arg )
321327
322328 group_required = []
323329 groups = []
0 commit comments