Skip to content

Add AnswerId field to PostBetRequest - #12

Merged
jonnyspicer merged 1 commit into
mainfrom
fix/issue-10-answer-id
Feb 16, 2026
Merged

jonnyspicer merged 1 commit into
mainfrom
fix/issue-10-answer-id

Conversation

@jonnyspicer

Copy link
Copy Markdown
Owner

Summary

  • Add AnswerId field to PostBetRequest struct for placing bets on specific answers in multiple-choice markets
  • Field uses omitempty so it's excluded from JSON when empty (binary market bets)
  • Add TestPostBetWithAnswerId test verifying serialization with and without the field

Fixes #10

Test plan

  • go test ./... passes
  • go vet ./... clean
  • New test verifies answerId appears in request JSON when set
  • New test verifies answerId is omitted from request JSON when empty

🤖 Generated with Claude Code

The Manifold API requires an answerId when placing bets on specific
answers in multiple-choice markets. Add this optional field to
PostBetRequest with omitempty so it's excluded for binary markets.

Fixes #10

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jonnyspicer
jonnyspicer merged commit af1e9be into main Feb 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostBetRequest missing answerId field for multi-choice markets

1 participant