Skip to content

IGA-719: add JSON round-trip regression test for integer-as-string types - #119

Merged
btipling merged 2 commits into
mainfrom
fix/marshal-json-integer-string-tags-src-t1m2-src-80pb
Aug 25, 2026
Merged

IGA-719: add JSON round-trip regression test for integer-as-string types#119
btipling merged 2 commits into
mainfrom
fix/marshal-json-integer-string-tags-src-t1m2-src-80pb

Conversation

@btipling

@btipling btipling commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds a regression test for the Go SDK's JSON handling of types with integer:"string" tags. The API serializes int64 values as JSON strings, like "12345", and the SDK's generated types were erroring on marshal and failing to unmarshal string values into int64 fields. The 17 affected types were already fixed in main; this PR locks that behavior in with a round-trip test that covers every one of them.

Linear

IGA-719: Go SDK MarshalJSON fails on union type with all fields null

Linear requirements

This PR is test-only. The 17 type fixes it validates are already in main; this PR adds the regression test covering all 17 affected types.

Requirement Status Evidence
I1: fix applies to all 17 types with integer:"string" tags ✅ Met the fixes are already in main (e.g. facetvalue.go, int64rules.go have MarshalJSON); this PR is test-only
I2: use the utils.MarshalJSON / utils.UnmarshalJSON delegation pattern ✅ Met the fixes in main use the delegation pattern
I3: include the regression test covering all 17 affected types ✅ Met marshal_roundtrip_test.go has a round-trip case for all 17 affected types
I4: go build ./... and go test ./... pass 🔍 Not verifiable depends on CI
I5: PR #104 carries the implementation 🔍 Not verifiable PR #104 is a separate open PR

Release Notes

No user-facing change. This PR adds a regression test for the Go SDK's JSON handling of integer-as-string fields; the underlying fix is already in main.

What changed

No production files. This is a test-only PR.

Excluded

  • pkg/models/shared/marshal_roundtrip_test.go — new regression test. It unmarshals each of the 17 affected types from JSON, marshals back, and asserts the output is lossless and round-trips through a fresh instance. It also covers the exact List Users → marshal scenario from the issue.

btipling and others added 2 commits August 24, 2026 23:29
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
- Add lossless-vs-input assertion and fresh-target round-trip (FN4)
- Add integer:"string" list-response test (FN1)
- Add negative/error-path unmarshal tests (FN3)
- Replace fragile raw-JSON Contains with structured assertions (FN5)
- Assert all fields in SFixed64Rules/SInt64Rules cases (FN6)
- Correct Facets test input to only real fields

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
@btipling btipling changed the title Implement src-80pb IGA-719: add JSON round-trip regression test for integer-as-string types Aug 25, 2026
@linear-code

linear-code Bot commented Aug 25, 2026

Copy link
Copy Markdown

IGA-719

@btipling
btipling merged commit e70ea3d into main Aug 25, 2026
2 checks passed
@btipling
btipling deleted the fix/marshal-json-integer-string-tags-src-t1m2-src-80pb branch August 25, 2026 20:49
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