Skip to content

feat(types): optional bool and number fields are pointers, norbix.Bool / norbix.Float64 - #50

Merged
Domantas merged 2 commits into
mainfrom
fix/optional-bools-pointer
Oct 22, 2026
Merged

Domantas merged 2 commits into
mainfrom
fix/optional-bools-pointer

Conversation

@Domantas

Copy link
Copy Markdown
Contributor

Owner decision 2026-10-22 (finding L32): an optional true/false field in the Go SDK must be able to carry false.

Before, every generated field was a value with omitempty, so dtos.SaveLogSettings{SkipHttpBodyMeta: false} sent nothing and the gateway (C# bool?, absent = unchanged) kept the old value.

What changed (regenerated from the gateway, refactoringV2, with typegen b802c5f):

  • nullable bool / number in the contract → *bool / *float64 + omitempty (hub 40 + 165 fields, api 17 + 52): nil is not sent, false / 0 is.
  • required bool → bool without omitempty (hub 338, api 69): always sent, so IsEnabled: false and DryRun: false reach the gateway.
  • No type added or lost (api 284, hub 1649); no other field changed.
  • New helpers norbix.Bool(v) and norbix.Float64(v); README "Optional fields" section; Logs guide and SaveLogSettings comment updated.

Tests: go test ./... 176 passed, 0 failed; go vet ./... and gofmt -l . clean. New: norbix/optional_test.go — SaveLogSettings with Bool(false) sends "skipCloudDashboardLogs":false and leaves nil out; a logging integration with IsEnabled: false sends "isEnabled":false; GetPaymentsWebhookLog with Limit: Float64(0) sends limit=0, nil sends nothing.

Breaking: optional bool fields are now *bool — use norbix.Bool(...). Optional number fields are now *float64 — use norbix.Float64(...); check a pointer for nil when you read a response. A required bool is now always sent, so a field you leave unset sends false instead of the gateway's own default (for example DryRun, IsSandbox, IsEnabled on a webhook destination).

🤖 Generated with Claude Code

Domantas and others added 2 commits October 22, 2026 07:43
…l / norbix.Float64

The generated types could not send false: every field was a value with
omitempty, so SaveLogSettings{SkipHttpBodyMeta: false} sent nothing and the
gateway (C# bool?, absent = unchanged) kept the old value.

Regenerated from the gateway (refactoringV2) with the updated type generator:
- nullable bool / number in the contract -> *bool / *float64 + omitempty
  (hub 40 + 165, api 17 + 52 fields): nil is not sent, false / 0 is
- required bool -> bool without omitempty (hub 338, api 69): always sent, so
  IsEnabled: false and DryRun: false reach the gateway
- no type added or lost (api 284, hub 1649), no other field changed

New helpers norbix.Bool(v) and norbix.Float64(v). Tests prove false and 0
are sent and nil is left out (SaveLogSettings, a logging integration with
IsEnabled false, GetPaymentsWebhookLog Limit 0).

Breaking: optional bool fields are now *bool — use norbix.Bool(...). Optional number fields are now *float64 — use norbix.Float64(...); check a pointer for nil when you read a response. A required bool is now always sent, so a field you leave unset sends false instead of the gateway's own default (for example DryRun, IsSandbox, IsEnabled on a webhook destination).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…witches a setting off

README gets an "Optional fields" section (norbix.Bool / norbix.Float64) and
the MCP tool hints note now says ReadOnlyHint / DestructiveHint are *bool.
The SaveLogSettings comment and the Logs guide drop the "send a map, the
struct drops false" workaround.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Domantas
Domantas merged commit 88961a7 into main Oct 22, 2026
6 checks passed
@Domantas
Domantas deleted the fix/optional-bools-pointer branch October 22, 2026 04:45
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.32.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant