aws/aws-sdk-cpp

Build fails for Legacy mode ON for custom clients, KeyError: 'serviceName'

ajishna opened this issue · 4 comments

Describe the bug

When building the script for generate_sdks fail with:

Generating <my_service_name> api version <my_service_version>.
Traceback (most recent call last):

  File "aws-sdk-cpp\tools\scripts\legacy\generate_sdks.py", line 164, in <module>
    main()
  File "aws-sdk-cpp\tools\scripts\legacy\generate_sdks.py", line 153, in main
    generate_sdk(arguments['pathToGenerator'], sdks[key], arguments['outputLocation'], arguments['namespace'],
  File "aws-sdk-cpp\tools\scripts\legacy\generate_sdks.py", line 98, in generate_sdk
    process = Popen(['java', '-jar', jar_path, '--service', sdk['serviceName'], '--version', sdk['apiVersion'],
KeyError: 'serviceName'

The issue is because the key is defined as service_name and used as serviceName.
In tools/scripts/legacy/generate_sdks.py,

Line 76 :

sdk = {'service_name': service_name, 'apiVersion': match.group(2), 'filePath': join(discovery_path, file)}

Issue is in Line 98:

 process = Popen(['java', '-jar', jar_path, '--service', sdk['serviceName'], '--version', sdk['apiVersion'],

where the key is called using serviceName instead of service_name.

Expected Behavior

Build should not fail

Current Behavior

Build fails with KeyError

Reproduction Steps

Build custom client with -DLEGACY_BUILD=ON

Possible Solution

Rename serviceName to service_name at Line 98
or make the key names consistent (following naming/casing guidelines)

Additional Information/Context

No response

AWS CPP SDK version used

1.11.169

Compiler and Version used

Visual Studio 2022

Operating System and version

Windows 10

jmklix commented

Does this PR fix the error you are getting when generating this sdk?

Merged PR. closing this issue

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.