Skip to content

refactor Volume class to use dataclass and dataclass_json#90

Merged
tamirse merged 3 commits intomasterfrom
refactor/volume-dataclass
Mar 30, 2026
Merged

refactor Volume class to use dataclass and dataclass_json#90
tamirse merged 3 commits intomasterfrom
refactor/volume-dataclass

Conversation

@tamirse
Copy link
Copy Markdown
Collaborator

@tamirse tamirse commented Mar 30, 2026

Replaces the manual __init__/property/create_from_dict pattern with @dataclass + @dataclass_json for consistency with the Instance class. Undefined.EXCLUDE silently drops unknown API fields; infer_missing defaults missing optional fields to None. Retains create_from_dict as a deprecated shim for backwards compatibility.

tamirse and others added 3 commits March 27, 2026 13:09
Replaces the manual __init__/property/create_from_dict pattern with
@DataClass + @dataclass_json for consistency with the Instance class.
Undefined.EXCLUDE silently drops unknown API fields; infer_missing
defaults missing optional fields to None. Retains create_from_dict as
a deprecated shim for backwards compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All optional fields already have defaults on the dataclass, so
infer_missing is unnecessary. Removing it gives stricter validation:
a response missing a required field like id or name will raise
immediately instead of silently setting None.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shamrin shamrin self-requested a review March 30, 2026 10:37
@tamirse tamirse merged commit 4ceea69 into master Mar 30, 2026
14 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.

2 participants