Azure / autorest.az

Azure CLI Code Generator
MIT License
22 stars 20 forks source link

Duplicate Keyword Error #787

Closed jobala closed 3 years ago

jobala commented 3 years ago

Overview

The mail extension is generated with duplicate keyword arguments. This causes the commands to fail. You can find the swagger description used to generate this extension in msgraph-cli under the open-api-docs directory.

Command

./mg mail user create-message --user-id ce68603c-2a23-4f54-9891-5e465525244f --subject "Yo" --body content="Here is my message" content-type="application/text" --to-recipient '{"emailAddress":{"address":"garth@contoso.com"}}'

Stacktrace

ERROR: keyword argument repeated (custom.py, line 629)
Traceback (most recent call last):
  File "C:\Users\jaobala\.virtualenvs\msgraph-cli-PlXl7MbP\lib\site-packages\knack\cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "C:\Users\jaobala\Desktop\workspace\microsoft\msgraph-cli\msgraph\cli\core\invocation.py", line 121, in execute
    self.commands_loader.load_arguments(command)
  File "C:\Users\jaobala\Desktop\workspace\microsoft\msgraph-cli\msgraph\cli\core\command_loaders\main.py", line 80, in load_arguments
    self.command_table[command].load_arguments()
  File "C:\Users\jaobala\.virtualenvs\msgraph-cli-PlXl7MbP\lib\site-packages\knack\commands.py", line 106, in load_arguments
    cmd_args = self.arguments_loader()
  File "C:\Users\jaobala\Desktop\workspace\microsoft\msgraph-cli\msgraph\cli\core\command_loaders\extension.py", line 93, in default_arguments_loader
    op = handler or self.get_op_handler(operation,
  File "C:\Users\jaobala\Desktop\workspace\microsoft\msgraph-cli\msgraph\cli\core\command_loaders\extension.py", line 144, in get_op_handler
    op = import_module(mod_to_import)
  File "c:\users\jaobala\appdata\local\programs\python\python38\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\jaobala\.virtualenvs\msgraph-cli-PlXl7MbP\lib\site-packages\azext_mail_v1_0\custom.py", line 13, in <module>
    from .generated.custom import *  # noqa: F403
  File "C:\Users\jaobala\.virtualenvs\msgraph-cli-PlXl7MbP\lib\site-packages\azext_mail_v1_0\generated\custom.py", line 629
    is_approval_request=is_approval_request,
    ^
SyntaxError: keyword argument repeated
qiaozha commented 3 years ago

won't be able to repro with latest code generator private package. https://github.com/Azure/autorest.az/releases/download/1.7.3-b.20210317.2/autorest-az-1.7.3.tgz

You can always find the latest code generator package from https://github.com/Azure/autorest.az/releases here.

qiaozha commented 3 years ago

Just found out the problem is in message rule creation not in the message creation ?

qiaozha commented 3 years ago

merged. Please use our latest private release to resolve this issue. Thanks

jobala commented 3 years ago

@qiaozha this issue still persists.

autorest.za: 1.7.3-b.20210325.1