Skip to content

fix: handle numeric project id in deploy response deserialization#307

Merged
amountainram merged 1 commit into
mainfrom
fix/deploy-struct-unmarshal
May 13, 2026
Merged

fix: handle numeric project id in deploy response deserialization#307
amountainram merged 1 commit into
mainfrom
fix/deploy-struct-unmarshal

Conversation

@amountainram

Copy link
Copy Markdown
Contributor

##Description:

GitLab pipeline trigger responses return the project id as a number, causing json.Unmarshal to fail with:

cannot unmarshal number into Go struct field DeployProject.id of type string

Added a custom UnmarshalJSON method on DeployProject that accepts both string and numeric id values, coercing numbers to strings.

GitLab returns project id as a number, which fails to unmarshal
into a string field. Add custom UnmarshalJSON to accept both
string and numeric id values.
@amountainram amountainram requested a review from a team as a code owner May 13, 2026 07:23
@amountainram amountainram merged commit 43fc23a into main May 13, 2026
10 checks passed
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.

2 participants