You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement base model class with serialization helpers #36
All response models should share a common base that provides from_dict(data: dict), to_dict(), and a readable __repr__. Using Pydantic as the base eliminates boilerplate validation and gives free type coercion.
Proposed Steps:
Create src/shade/models/__init__.py and src/shade/models/base.py.
Define ShadeObject(pydantic.BaseModel) with model_config = ConfigDict(populate_by_name=True, extra="allow").
Add to_dict() method wrapping model.model_dump().
Add a classmethod from_dict(cls, data: dict) that constructs the model.
Override __repr__ to show class name and primary ID field.
Acceptance Criteria:
All models can be round-tripped through from_dict(m.to_dict()) without data loss.
Unknown fields from the API are accepted without raising (extra="allow").
repr(model) shows the class name and key ID field.
Pydantic validation errors surface as InvalidRequestError, not raw ValidationError.
please assign this issue to me. I have experience designing Python SDKs with a strong focus on maintainability, type safety, and clean model abstractions. I've worked with Pydantic-based models, centralized validation, and reusable base classes that reduce duplication while keeping APIs intuitive and consistent.
For this issue, I would introduce a shared ShadeObject base model in src/shade/models/base.py and expose it through src/shade/models/init.py. The base class would use ConfigDict(populate_by_name=True, extra="allow") to support flexible API responses while preserving type validation. I'd implement from_dict() and to_dict() helpers to provide a consistent serialization interface, along with a custom repr that highlights the model's class name and primary identifier for easier debugging.
Activity
KodeSage commentedon Jul 21, 2026
please assign this issue to me. I have experience designing Python SDKs with a strong focus on maintainability, type safety, and clean model abstractions. I've worked with Pydantic-based models, centralized validation, and reusable base classes that reduce duplication while keeping APIs intuitive and consistent.
For this issue, I would introduce a shared ShadeObject base model in src/shade/models/base.py and expose it through src/shade/models/init.py. The base class would use ConfigDict(populate_by_name=True, extra="allow") to support flexible API responses while preserving type validation. I'd implement from_dict() and to_dict() helpers to provide a consistent serialization interface, along with a custom repr that highlights the model's class name and primary identifier for easier debugging.
grantfox-oss commentedon Jul 21, 2026
🦊 GrantFox — @KodeSage has been assigned to this issue as part of the Official Campaign | FWC26 campaign!
Next steps:
Closes #36)Good luck! Track your progress on GrantFox.
grantfox-oss commentedon Jul 24, 2026
🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign | FWC26 campaign!
@KodeSage's PR #47 was approved and merged by @codebestia.
🏆 @KodeSage: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (242 total points). Track your full progress on GrantFox.
👏 Great work, @KodeSage! Keep contributing to ShadeProtocol.