This repository was archived by the owner on Apr 15, 2026. It is now read-only.
fix(teams): omit group_id from Create/Update payload when empty#62
Merged
vmvarela merged 1 commit intoenterprise-teamsfrom Mar 23, 2026
Merged
fix(teams): omit group_id from Create/Update payload when empty#62vmvarela merged 1 commit intoenterprise-teamsfrom
vmvarela merged 1 commit intoenterprise-teamsfrom
Conversation
Only set GroupID in the API request when non-empty, consistent with how description is handled. Sending an empty string pointer serializes as "group_id": "" in the JSON payload which may cause unexpected API behavior. Omitting the field (nil pointer with omitempty) is the correct way to create a team without a group assignment. Closes #56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #56
Only set
GroupIDin the Create/Update API request when non-empty, consistent with howdescriptionis handled throughout the codebase.Problem
The SDK struct uses
GroupID *stringjson:"group_id,omitempty"``. Sendinggithub.Ptr("")serializes as `"group_id": ""` in the JSON payload — the field is not omitted by `omitempty` because the pointer is non-nil. This can cause unexpected API behavior for teams created without a group assignment.Fix
Tests
TestAccGithubEnterpriseTeam: 3/3 passing (create, update, import — all without group_id).