-
Notifications
You must be signed in to change notification settings - Fork 56
fix: create bot with omitempty #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughUpdated JSON struct tags in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
bots.go (1)
195-202:omitemptyon pointer fields inCreateBotsReqlooks good; please verify API contract for null vs missingAdding
omitemptytoPromptInfo,OnboardingInfo,ModelInfoConfig, andWorkflowIDListalignsCreateBotsReqwith theBotresponse struct and avoids sending explicitnullwhen these pointers are nil, which is a sensible default. The main behavior change is that the keys will now be omitted instead of serialized asnull, so this relies on the backend treating “missing” the same as “null” for these fields.Also note that
UpdateBotsReqstill sends these fields withoutomitempty, which is likely intentional if the API usesnullto mean “clear this field” vs. “leave unchanged”.I’d suggest:
- Double-checking with the API contract or running integration tests that create bots with these pointers left nil to confirm the server accepts omitted fields exactly as intended.
- Optionally, adding a small encoding test for
CreateBotsReqto lock in the expected JSON shape for nil vs. non-nil pointer cases.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.