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: Add support for list and maps generated as value members instead of pointer #887

Merged
merged 9 commits into from
Nov 15, 2020

Conversation

jasdel
Copy link
Contributor

@jasdel jasdel commented Nov 11, 2020

Updates the SDK code generation to make use of the new smithy NullableIndex and smithy-go's GoPointableIndex. These utilities allow the SDK's code generation to be aware of API shapes and members that are nullable, and can be rendered as values by the code generation instead of pointers.

This update updates the SDK's code generation types to be value instead of pointer in most cases.

  • Numbers (int8, int16, int32, int64, float32, float64)
  • bool
  • lists - e.g. []string instead of []*string
  • maps - e.g. map[string]string instead of map[string]*string.

Number and boolean types that are not boxed (not pointer) will not serialize their zero value unless they are members of a list or map.

This change also significantly refactors how the SDK represents nullability and pointability when generation types and members from an API model. Utilities were added in the smithy-go change that help ensure more consistent logic through the sdk's code generation.

Depends on aws/smithy-go#232
Fixes #896

@jasdel jasdel changed the title codegen add support for list and maps generated as value members instead of pointer codegen: Add support for list and maps generated as value members instead of pointer Nov 11, 2020
@jasdel jasdel force-pushed the denseListMap branch 2 times, most recently from d6abc63 to 168e993 Compare November 12, 2020 18:57
@skmcgrail
Copy link
Member

Have you ran make integration to verify these changes?

@jasdel
Copy link
Contributor Author

jasdel commented Nov 13, 2020

Yeah verified that all integration tests pass successfully.

@skotambkar
Copy link
Contributor

Looks like smithy-go dep version is not correct? CI for Java fails as it doesn't find methods from aws/smithy-go#232

@jasdel
Copy link
Contributor Author

jasdel commented Nov 14, 2020

That's probably result of bad merge. There where no Go changes in the smithy-go change. I won't be able to have CI succeed on this PR until the smithy change is merged because it depends on Java changes in that pr.

@jasdel jasdel merged commit a822645 into aws:master Nov 15, 2020
@jasdel jasdel deleted the denseListMap branch November 15, 2020 20:50
jasdel added a commit to jasdel/aws-sdk-go-v2 that referenced this pull request Nov 15, 2020
Fixes up documentation comments that were missed in aws#887
jasdel added a commit that referenced this pull request Nov 16, 2020
Fixes up documentation comments that were missed in #887
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

codegen: SDK use API model to render parameters as value instead of pointers types
3 participants