aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.98k stars 1.06k forks source link

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

Closed ajishna closed 1 year ago

ajishna commented 1 year ago

Describe the bug

When building the script for generate_sdks fail with:

Generating api 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 1 year ago

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

ajishna commented 1 year ago

Yes, that PR fixes the issue.

On Tue, Oct 17, 2023 at 4:40 PM Joseph Klix @.***> wrote:

Does this PR https://github.com/aws/aws-sdk-cpp/pull/2720 fix the error you are getting when generating this sdk?

— Reply to this email directly, view it on GitHub https://github.com/aws/aws-sdk-cpp/issues/2712#issuecomment-1767360546, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKJYAE2JBTJMAA43HMU2EMLX74JPDAVCNFSM6AAAAAA57MPFNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRXGM3DANJUGY . You are receiving this because you authored the thread.Message ID: @.***>

jmklix commented 1 year ago

Merged PR. closing this issue

github-actions[bot] commented 1 year ago

⚠️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.