Skip to content

Conversation

@franccesco
Copy link
Owner

Summary

  • Fixed Pydantic validation errors when the Bloom Growth API returns null for Position.name field
  • Made Position.name optional (str | None = None) in the models
  • Added comprehensive tests for null position name handling

Changes

  • src/bloomy/models.py: Changed Position.name from required str to optional str | None
  • tests/test_users.py: Added two new tests:
    • test_positions_with_null_name - Tests positions() method with null names
    • test_details_with_positions_null_name - Tests details(all=True) with null position names

Context

The UserOperations methods positions(), details(include_positions=True), and details(all=True) were failing with Pydantic validation errors because the API returns null for Position.name but the model had it defined as a required field.

Test plan

  • All existing tests pass
  • New tests cover null name scenarios
  • Tests verify both positions() and details(all=True) handle null names correctly

🤖 Generated with Claude Code

The Bloom Growth API can return null for Position.name field, causing
Pydantic validation errors in UserOperations methods like positions(),
details(include_positions=True), and details(all=True).

- Changed Position.name from required str to optional str | None
- Added tests for positions() with null names
- Added tests for details(all=True) with null position names

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@franccesco franccesco merged commit a657d34 into main Dec 11, 2025
6 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.

1 participant