File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import click
1010
1111from samcli .cli .command import _SAM_CLI_COMMAND_PACKAGES
12- from samcli .cli .lazy_group import LazyGroup
1312from samcli .lib .config .samconfig import SamConfig
1413from schema .exceptions import SchemaGenerationException
1514
@@ -199,15 +198,10 @@ def create_command_schema(module, subcommand):
199198 command = []
200199
201200 if isinstance (module .cli , click .core .Group ): # command has subcommands (e.g. local invoke)
202- # For LazyGroup, load lazy commands first (preserving definition order)
203- if isinstance (module .cli , LazyGroup ) and module .cli .lazy_subcommands :
204- for subcommand_name in module .cli .lazy_subcommands .keys ():
205- subcommand = module .cli .get_command (None , subcommand_name )
206- if subcommand :
207- command .append (create_command_schema (module , subcommand ))
208- else :
209- # For regular Groups, use commands dict
210- for subcommand in module .cli .commands .values ():
201+ ctx = click .Context (module .cli )
202+ for subcommand_name in module .cli .list_commands (ctx ):
203+ subcommand = module .cli .get_command (ctx , subcommand_name )
204+ if subcommand :
211205 command .append (create_command_schema (module , subcommand ))
212206 else :
213207 cmd_name = SamConfig .to_key ([module .__name__ .split ("." )[- 1 ]])
Original file line number Diff line number Diff line change 408408 " parameters"
409409 ]
410410 },
411+ "local_generate_event" : {
412+ "title" : " Local Generate Event command" ,
413+ "description" : " Generate events for Lambda functions." ,
414+ "properties" : {
415+ "parameters" : {
416+ "title" : " Parameters for the local generate event command" ,
417+ "description" : " Available parameters for the local generate event command:\n * " ,
418+ "type" : " object" ,
419+ "properties" : {}
420+ }
421+ },
422+ "required" : [
423+ " parameters"
424+ ]
425+ },
411426 "local_invoke" : {
412427 "title" : " Local Invoke command" ,
413428 "description" : " Invoke AWS serverless functions locally." ,
10241039 " parameters"
10251040 ]
10261041 },
1027- "local_generate_event" : {
1028- "title" : " Local Generate Event command" ,
1029- "description" : " Generate events for Lambda functions." ,
1030- "properties" : {
1031- "parameters" : {
1032- "title" : " Parameters for the local generate event command" ,
1033- "description" : " Available parameters for the local generate event command:\n * " ,
1034- "type" : " object" ,
1035- "properties" : {}
1036- }
1037- },
1038- "required" : [
1039- " parameters"
1040- ]
1041- },
10421042 "package" : {
10431043 "title" : " Package command" ,
10441044 "description" : " Package an AWS SAM application." ,
You can’t perform that action at this time.
0 commit comments