Closed Zouarfi closed 5 months ago
aws.protocols#restJson1
is an AWS protocol, I think you'd have to include smithy-aws-typescript-codegen
in addition to this do handle that.
Hello,
Thanks for the reply!
By mentioning AWS Protocol, I have double checked our definition and it appears that in fact, it is required to provide the trait @service
when generating TypeScript SDK on version 0.20.0
.
I have updated our Smithy definition and now it works like a charm!
Thank you very much!
Hi,
I want to ask for clarification whether providing aws.api#service
trait is required alongside aws.protocol#restJson1
.
The official example for generating typescript clients mentions only @restJson1
trait.
https://smithy.io/2.0/guides/using-code-generation/update-model.html#id4.
Including @service
annotation triggers aws-sdk specific codegen to be triggered (including code regarding regions etc), which isn't desireable in case of generating plain http clients (not part of aws sdk).
It appears that when we use typescript-codegen with
0.20.0
the package@aws-sdk/core
is missing in the generatedpackage.json
.
The overarching issue has been fixed in these PRs, and will go out in the next release: #1239, aws/aws-sdk-js-v3#6000
Hello,
Thanks for the reply!
By mentioning AWS Protocol, I have double checked our definition and it appears that in fact, it is required to provide the trait
@service
when generating TypeScript SDK on version0.20.0
. I have updated our Smithy definition and now it works like a charm!Thank you very much!
The aws.api#service
trait should not be strictly required when using any of the AWS protocol traits (e.g. aws.protocol#restJson1
.
Further investigation will be done in https://github.com/smithy-lang/smithy-typescript/issues/1242#issuecomment-2057727525
Wow thanks for catching up! Good news then
Hello,
It appears that when we use typescript-codegen with
0.20.0
the package@aws-sdk/core
is missing in the generatedpackage.json
.This lead to unusable package when it is used with the trait
@restJson1
.Here's the diff between the
package.json
from0.19.0
to0.20.0
: