Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@aws-sdk/client-cloudfront ListDistributionsCommand returns incorrect "HttpVersion" value #6605

Open
3 tasks done
Jianru-Lin opened this issue Dec 21, 2023 · 3 comments
Open
3 tasks done
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.

Comments

@Jianru-Lin
Copy link

Jianru-Lin commented Dec 21, 2023

Checkboxes for prior research

Describe the bug

I am working on integrating the Cloudfront service with our internal system.

However, I found that the ListDistributionsCommand returns the incorrect "HttpVersion" value.

It returns "HTTP2and3" instead of "http2and3".

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.9.0

Reproduction Steps

  1. Log in to the AWS CloudFront dashboard.
  2. Create a new distribution; Make sure to select both HTTP/2 and HTTP/3 in the "Supported HTTP versions" section, then submit to create.
  3. Write a minimal node.js code with @aws-sdk/client-cloudfront to send a ListDistributionsCommand request. Check the response to reproduce the bug.

Observed Behavior

This is what I got from aws server:

{
    "$metadata": {
        "httpStatusCode": 200,
        "requestId": "1a551a4f-8a33-4a57-9186-ed4461621524",
        "attempts": 1,
        "totalRetryDelay": 0
    },
    "DistributionList": {
        "Marker": "",
        "MaxItems": 100,
        "IsTruncated": false,
        "Quantity": 1,
        "Items": [
            {
                "Id": "E39HM9L49VTJZO",
                // ... some fields
                "HttpVersion": "HTTP2and3", // 👈 this is wrong, should be "http2and3"
                // ... some fields
            }
        ]
    }
}

Expected Behavior

The value of the "HttpVersion" field should be "http2and3" instead of "HTTP2and3".

This value is incorrect because it does not align with two things:

  • It does not follow the type declaration of /node_modules/@aws-sdk/client-cloudfront/dist-types/models/models_0.d.ts
  • It does not follow what GetDistributionCommand returns (it returns the right value "http2and3")

Possible Solution

No response

Additional Information/Context

For reference purpose, this is what defined in /node_modules/@aws-sdk/client-cloudfront/dist-types/models/models_0.d.ts:

export declare const HttpVersion: {
    readonly http1_1: "http1.1";
    readonly http2: "http2";
    readonly http2and3: "http2and3";
    readonly http3: "http3";
};
@Jianru-Lin Jianru-Lin added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 21, 2023
@RanVaknin
Copy link
Contributor

Hi @Jianru-Lin ,

Thanks for reaching out. If you didn't know the AWS SDKs are code generated from the API models defined by each service team. In this case, the Cloudfront team has modeled this enum with all lowercase values as seen in the internal API model that each SDK holds.

I would have to reach out to the Cloudfront service team to either change the enum value or correct the value they return.

Aside from spotting the discrepancy, is there anything here that is blocking you?

Thanks,
Ran~

P110186243

@RanVaknin RanVaknin self-assigned this Dec 22, 2023
@RanVaknin RanVaknin removed the needs-triage This issue or PR still needs to be triaged. label Dec 22, 2023
@RanVaknin RanVaknin transferred this issue from aws/aws-sdk-js-v3 Dec 22, 2023
@RanVaknin RanVaknin added the service-api This issue is due to a problem in a service API, not the SDK implementation. label Dec 22, 2023
@Jianru-Lin
Copy link
Author

@RanVaknin Thank you for reporting this bug to Cloudfront service team.

@amberkushwaha
Copy link

Add a comment and paste drop markdown is also supported in the file also.

@zshzbh zshzbh transferred this issue from aws/aws-sdk Oct 30, 2024
@zshzbh zshzbh added the p2 This is a standard priority issue label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

4 participants