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

GoCodeWriter's $T and $P generate unexpected types for list and maps. #149

Closed
jasdel opened this issue Aug 24, 2020 · 0 comments · Fixed by #232
Closed

GoCodeWriter's $T and $P generate unexpected types for list and maps. #149

jasdel opened this issue Aug 24, 2020 · 0 comments · Fixed by #232
Labels
enhancement New feature or request

Comments

@jasdel
Copy link
Contributor

jasdel commented Aug 24, 2020

We should take a look at how slice/map types are generated from $T, and $P. If a member is or is not a pointer of a slice/map should not be driven by $T, or $P, the member being a pointer is driven by the modeled list/map shape, and its member.

This mean that $T should generate the correct Go type for a map of strings, i.e. map[string]*string. In addition the same for lists (assuming lists cannot be sparse, i.e. []string. Using $P should generate the pointer type of the outer shape, *map[string]*string and *[]string. $P should have no impact on the generate of nested members within collections.

@jasdel jasdel mentioned this issue Aug 24, 2020
@jasdel jasdel added the enhancement New feature or request label Nov 11, 2020
jasdel added a commit that referenced this issue Nov 15, 2020
…#232)

Adds a new KnowedgeIndex implementation GoPointableIndex this index declares when a shape should be a pointer or value type in Go code. Updates the SDK's code generation so that all non-sparse list and maps are rendered with value members instead of pointers. This null-ability applies to number and boolean members to that are not explicitly decorated as boxed.

Fixes #128
Fixes #127
Fixes #149
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant