Coder Social home page Coder Social logo

Comments (4)

jasdel avatar jasdel commented on August 20, 2024 1

Thanks for reaching out @jabalsad. Currently the smithy-go code generation is a basic smithy generator that does not yet have any protocol implementations. All protocol implementations are in the aws-sdk-go-v2's smithy code generation. This is one of the main reasons the smithy-go codegen has limited documentation is not published to maven central yet.

With that said, I think its reasonable to investigate moving the aws-sdk-go-v2 codegen implementation of awsRestJson1 to smithy-go as a opinionated generic REST JSON smithy protocol implementation. This most likely will require extracting/decoupling AWS specific traits, behavior, and AWS codegen utilities from the awsRestJson1 protocol implementation. This would be the first step to investigate at how tightly the awsRestJson1 protocol implementation s coupled with the AWS code generators.

The AwsRestJson1.java is the implementation of this protocol in the v2 SDK's codegen, which is basically just RestJsonProtocolGenerator. The smithy-go HttpBindingProtocolGenerator provides the bulk of the HTTP REST implementation with RestJsonProtocolGenerator defining mostly the JSON serde, and middleware.

from smithy-go.

jabalsad avatar jabalsad commented on August 20, 2024

Actually, I think this problem might be core to the issue we're facing. Besides the VSCode editor complaining that it cannot resolve the restJson1 trait, we also realize that the generated go client contains no implementation for serializing, deserializing and building the request/response cycles.

We've tried to implement these ourselves, but with no luck due to poor documentation. Any advice on how to go about solving this problem? This is a blocker for us.

from smithy-go.

jhecking avatar jhecking commented on August 20, 2024

I managed to build the smithy-aws-go-codegen and smithy-go-codegen packages and then use them to generate client Go code for the simple weather demo model.

Unfortunately, the generated code has a few dependencies on internal packages of the AWS SDK package, e.g.

api_client.go:	internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
internal/endpoints/endpoints.go:	endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"

That makes the generated code pretty much unusable at the moment. On the other hand, it looks like maybe the effort required to generate code that's decoupled from the AWS SDK might not be that big?

from smithy-go.

lucix-aws avatar lucix-aws commented on August 20, 2024

This is true for every aws protocol right now, moving to #458.

from smithy-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.