-
Notifications
You must be signed in to change notification settings - Fork 560
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
Incorrect interface types in Amazon CloudFront clients #6165
Comments
Hi @piotrekwitkowski - thanks for reaching out. I'm not able to reproduce with the code below. Can you share reproducible code for the error? import { CloudFrontClient, DescribeKeyValueStoreCommand } from "@aws-sdk/client-cloudfront";
const client = new CloudFrontClient({region: "us-west-1"});
const input = {
Name: "STRING_VALUE",
};
const command = new DescribeKeyValueStoreCommand(input);
const response = await client.send(command); Can you also share your Node & SDK version as well? |
Hi, updated Node and SDK version above. The issue is not about the good case, when you provide the Name value. It is about the case where I don't provide the value, which is a problem that should be caught way earlier, to improve developer experience. |
Thanks for your response. A few things to address here:
Hope it clears things up, let me know if there's any further questions! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Checkboxes for prior research
Describe the bug
Many of the required strings in the client's models are incorrectly typed as
string | undefined
, but required in practice. They should be typed asstring
instead.This applies for all commands of the client:
There are 13 occurrences of such bug across these 6 methods.
SDK version number
@aws-sdk/client-cloudfront@3.590.0
@aws-sdk/client-cloudfront-keyvaluestore@3.590.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Node v18.19.0
Reproduction Steps
In the
@aws-sdk/client-cloudfront
:Similar for the other client, from
@aws-sdk/client-cloudfront-keyvaluestore
Observed Behavior
These types should be
string
s - these fields are required by the API, and there is a runtime error if the value is not set:Expected Behavior
1/ SDK type mentioning
string
only,2/ my IDE / TypeScript able to detect this behavior at lint/compile time.
Possible Solution
Fix autogenerated types
Additional Information/Context
I may be able to fix the bug, please just tell me where to start.
The text was updated successfully, but these errors were encountered: