[PR #642] [MERGED] fix(asc): encode empty relationship list as [] #676

Closed
opened 2026-02-26 22:32:04 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/642
Author: @rudrankriyam
Created: 2/18/2026
Status: Merged
Merged: 2/18/2026
Merged by: @rudrankriyam

Base: mainHead: fix/relationship-request-empty-array


📝 Commits (1)

  • adbcc59 fix(asc): encode empty relationship list as []

📊 Changes

3 files changed (+51 additions, -1 deletions)

View changed files

📝 internal/asc/client_http_issue_616_game_center_detail_group_relationships_test.go (+14 -0)
📝 internal/asc/types/resources.go (+13 -0)
📝 internal/asc/types/resources_test.go (+24 -1)

📄 Description

What

  • Ensure to-many relationship payloads always encode data as an array ([]) instead of null.
  • Add regression tests for RelationshipRequest marshaling.
  • Add a request-shaping test that exercises clearing a to-many relationship.

Why

Go encodes nil slices as null, but JSON:API relationship lists use data: [] to represent an empty set. Sending data: null can make relationship replace requests behave unexpectedly (especially when attempting to clear a relationship).

Test Plan

  • make format
  • make lint
  • ASC_BYPASS_KEYCHAIN=1 make test

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/642 **Author:** [@rudrankriyam](https://github.com/rudrankriyam) **Created:** 2/18/2026 **Status:** ✅ Merged **Merged:** 2/18/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `main` ← **Head:** `fix/relationship-request-empty-array` --- ### 📝 Commits (1) - [`adbcc59`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/adbcc59901d32e76b10605af02c89c3636e93c63) fix(asc): encode empty relationship list as [] ### 📊 Changes **3 files changed** (+51 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `internal/asc/client_http_issue_616_game_center_detail_group_relationships_test.go` (+14 -0) 📝 `internal/asc/types/resources.go` (+13 -0) 📝 `internal/asc/types/resources_test.go` (+24 -1) </details> ### 📄 Description ## What - Ensure to-many relationship payloads always encode `data` as an array (`[]`) instead of `null`. - Add regression tests for `RelationshipRequest` marshaling. - Add a request-shaping test that exercises clearing a to-many relationship. ## Why Go encodes nil slices as `null`, but JSON:API relationship lists use `data: []` to represent an empty set. Sending `data: null` can make relationship replace requests behave unexpectedly (especially when attempting to clear a relationship). ## Test Plan - `make format` - `make lint` - `ASC_BYPASS_KEYCHAIN=1 make test` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 22:32:04 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#676
No description provided.