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 @@
{
".": "0.28.0"
".": "0.29.0"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.29.0 (2026-01-24)

Full Changelog: [v0.28.0...v0.29.0](https://github.com/kernel/kernel-go-sdk/compare/v0.28.0...v0.29.0)

### Features

* **client:** add a convenient param.SetJSON helper ([00e86b2](https://github.com/kernel/kernel-go-sdk/commit/00e86b280372cea0186578a4e73bf857310233e8))

## 0.28.0 (2026-01-22)

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

```sh
go get -u 'github.com/kernel/kernel-go-sdk@v0.28.0'
go get -u 'github.com/kernel/kernel-go-sdk@v0.29.0'
```

<!-- x-release-please-end -->
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 = "0.28.0" // x-release-please-version
const PackageVersion = "0.29.0" // x-release-please-version
18 changes: 18 additions & 0 deletions packages/param/param.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ func Override[T ParamStruct, PtrT InferPtr[T]](v any) T {
return *pt
}

// SetJSON configures a param struct to serialize with the provided raw JSON data.
// Use this when you have existing JSON that you want to send as request parameters.
//
// var req example.NewUserParams
// var rawJSON = []byte(`{"name": "...", "age": 40}`)
// param.SetJSON(rawJSON, &req)
// res, err := client.Users.New(ctx, req)
//
// Note: The struct's existing fields will be ignored; only the provided JSON is serialized.
func SetJSON(rawJSON []byte, ptr anyParamStruct) {
ptr.setMetadata(json.RawMessage(rawJSON))
}

// IsOmitted returns true if v is the zero value of its type.
//
// If IsOmitted is true, and the field uses a `json:"...,omitzero"` tag,
Expand Down Expand Up @@ -91,6 +104,11 @@ type ParamStruct interface {
extraFields() map[string]any
}

// A pointer to ParamStruct
type anyParamStruct interface {
setMetadata(any)
}

// This is an implementation detail and should never be explicitly set.
type InferPtr[T ParamStruct] interface {
setMetadata(any)
Expand Down