Repository navigation
feat(types): optional bool and number fields are pointers, norbix.Bool / norbix.Float64 - #50
Merged
Merged
Conversation
…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>
|
🎉 This PR is included in version 2.32.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, sodtos.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):
*bool/*float64+omitempty(hub 40 + 165 fields, api 17 + 52): nil is not sent,false/0is.boolwithoutomitempty(hub 338, api 69): always sent, soIsEnabled: falseandDryRun: falsereach the gateway.norbix.Bool(v)andnorbix.Float64(v); README "Optional fields" section; Logs guide andSaveLogSettingscomment updated.Tests:
go test ./...176 passed, 0 failed;go vet ./...andgofmt -l .clean. New:norbix/optional_test.go— SaveLogSettings withBool(false)sends"skipCloudDashboardLogs":falseand leaves nil out; a logging integration withIsEnabled: falsesends"isEnabled":false;GetPaymentsWebhookLogwithLimit: Float64(0)sendslimit=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