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

codegen: SDK use API model to render parameters as value instead of pointers types #896

Closed
jasdel opened this issue Nov 11, 2020 · 1 comment · Fixed by #887
Closed

codegen: SDK use API model to render parameters as value instead of pointers types #896

jasdel opened this issue Nov 11, 2020 · 1 comment · Fixed by #887
Labels
breaking-change Issue requires a breaking change to remediate. refactor

Comments

@jasdel
Copy link
Contributor

jasdel commented Nov 11, 2020

The Smithy API model provides information for the SDK's code generator to determine if a API input/output parameter must be nullable (aka optional), and when the parameter isn't nullable (aka unboxed). With this information the SDK's code generator can opportunistically render some parameters as value types instead of rendering all parameters as pointer types.

This information directly impacts how the SDK renders the following types.

  • List and Map members can be rendered as value if not decorated with @sparse trait
    • []string instead of []*string
    • map[string]string instead of map[string]*string
  • Number types (float32, int32, etc) struct members can be values.
  • Boolean struct members can be values.

In addition to this change the SDK should ensure it doesn't serialize number and bool parameters of structs that are unboxed.

Related issues

@jasdel jasdel added refactor breaking-change Issue requires a breaking change to remediate. labels Nov 11, 2020
@jasdel jasdel added this to the v1.0 Release Candidate milestone Nov 11, 2020
@jasdel jasdel changed the title codegen: SDK use API model to render paramaters as value instead of pointers types codegen: SDK use API model to render parameters as value instead of pointers types Nov 11, 2020
@github-actions
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Issue requires a breaking change to remediate. refactor
Projects
None yet
1 participant