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

generator-go-sdk: support model behaviors #4436

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

manicminer
Copy link
Contributor

Initial behavior to omit discriminated value when marshalling. Model behaviors are opt-in; enabled only for MS Graph at this time.

Example SDK Output

Screenshot 2024-09-23 at 12 57 42

Screenshot 2024-09-23 at 12 57 57

…iscriminated value when marshalling), enable for MS Graph
@manicminer manicminer added enhancement New feature or request tool/generator-go-sdk Issues with the Go SDK Generator labels Sep 23, 2024
Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @manicminer other than a suggestion on the naming and the comment LGTM 🍜

Comment on lines 77 to 78
// whether model behaviors are enabled
enableModelBehaviors bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this have a more descriptive name for what it does? I don't see why we couldn't name this omitDiscriminatedValue with more detail in the comment

Suggested change
// whether model behaviors are enabled
enableModelBehaviors bool
// whether the discriminated field should be omitted from a model and thus ignored in the marshalling/unmarshalling of the struct, this currently only applies to MS Graph models
omitDiscriminatedValue bool

@manicminer manicminer merged commit e402ea9 into main Sep 23, 2024
4 checks passed
@manicminer manicminer deleted the generator-go-sdk/support-model-behaviors branch September 23, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tool/generator-go-sdk Issues with the Go SDK Generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants