Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.2.0"
".": "2.2.1"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 2.2.1 (2026-02-10)

Full Changelog: [v2.2.0...v2.2.1](https://github.com/imagekit-developer/imagekit-go/compare/v2.2.0...v2.2.1)

### Bug Fixes

* **encoder:** correctly serialize NullStruct ([c8a223a](https://github.com/imagekit-developer/imagekit-go/commit/c8a223a358428b56cd5f13843928252c58acff90))


### Chores

* **internal:** codegen related update ([5071176](https://github.com/imagekit-developer/imagekit-go/commit/50711763c0f3bee01b36ab00500db61aa371415b))

## 2.2.0 (2026-02-02)

Full Changelog: [v2.1.1...v2.2.0](https://github.com/imagekit-developer/imagekit-go/compare/v2.1.1...v2.2.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/imagekit-developer/imagekit-go/v2@v2.2.0'
go get -u 'github.com/imagekit-developer/imagekit-go/v2@v2.2.1'
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/imagekit-developer/imagekit-go/v2
go 1.22

require (
github.com/standard-webhooks/standard-webhooks/libraries v0.0.0-20260114220421-3f69fd681bb0
github.com/standard-webhooks/standard-webhooks/libraries v0.0.0-20260204153508-82e3cc7ca7f2
github.com/tidwall/gjson v1.18.0
github.com/tidwall/sjson v1.2.5
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/standard-webhooks/standard-webhooks/libraries v0.0.0-20260114220421-3f69fd681bb0 h1:EZXYkItlI9VXF+3x/VFkP8JKa6ibJVZAMjHGfdjzHC8=
github.com/standard-webhooks/standard-webhooks/libraries v0.0.0-20260114220421-3f69fd681bb0/go.mod h1:L1MQhA6x4dn9r007T033lsaZMv9EmBAdXyU/+EF40fo=
github.com/standard-webhooks/standard-webhooks/libraries v0.0.0-20260204153508-82e3cc7ca7f2 h1:G8HmTGjWol06WYFuaB92Ii9WVd6/IRBkmAyc4OrmN8Y=
github.com/standard-webhooks/standard-webhooks/libraries v0.0.0-20260204153508-82e3cc7ca7f2/go.mod h1:L1MQhA6x4dn9r007T033lsaZMv9EmBAdXyU/+EF40fo=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "2.2.0" // x-release-please-version
const PackageVersion = "2.2.1" // x-release-please-version
3 changes: 3 additions & 0 deletions packages/param/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ func MarshalUnion[T ParamStruct](metadata T, variants ...any) ([]byte, error) {
}
}
if nPresent == 0 || presentIdx == -1 {
if metadata.null() {
return []byte("null"), nil
}
if ovr, ok := metadata.Overrides(); ok {
return shimjson.Marshal(ovr)
}
Expand Down
12 changes: 12 additions & 0 deletions packages/param/encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,15 @@ func TestOverriddenUnion(t *testing.T) {
})
}
}

func TestNullStructUnion(t *testing.T) {
nullUnion := param.NullStruct[PrimitiveUnion]()

b, err := json.Marshal(nullUnion)
if err != nil {
t.Fatalf("didn't expect error %v", err)
}
if string(b) != "null" {
t.Fatalf("expected null, received %s", string(b))
}
}
Loading