v0.3.0: Python Generator & Smart Type Resolution
Python Generator & Smart Type Resolution
New Features
-
Full Python Code Generator with 3 styles:
- ✅ Dataclasses (with slots, frozen, kw_only)
- ✅ Pydantic v2 models (with Field(), aliases, validation)
- ✅ TypedDict (with NotRequired for Python 3.11+)
-
Smart Type Resolution:
- None + concrete type = optional field (not conflict)
- Proper optional field detection
- Language-specific defaults (Python: snake_case fields)
-
Comprehensive Test Suite: 80+ tests with pytest
Improvements
- Analyzer detects optional fields when None is present
- Go generator never adds pointers to interface{}/any
- Python automatically uses PEP 8 conventions
- Better naming conflict resolution
Bug Fixes
- Fixed type_map serialization with dataclass slots
- Fixed sanitize_name() order for leading digits
- Fixed Pydantic Field() generation logic
- Fixed None value handling in merge_object_summaries()
Breaking Changes
- Minimum Python version: 3.11+ (for NotRequired support)
- Changed naming.sanitize_name() step order
Documentation
- Updated README and API docs
- Added configuration best practices
- Added type conflict resolution examples