Skip to content

fix: do not dump both class and class_ on Split - #148

Open
BetterAndBetterII wants to merge 1 commit into
landing-ai:mainfrom
BetterAndBetterII:fix/parse-response-class-alias
Open

fix: do not dump both class and class_ on Split#148
BetterAndBetterII wants to merge 1 commit into
landing-ai:mainfrom
BetterAndBetterII:fix/parse-response-class-alias

Conversation

@BetterAndBetterII

Copy link
Copy Markdown

Fixes #64.

Split.class_ is aliased to class. construct() treated the alias as an extra field, so model_dump_json() emitted both class and class_. JSON that only had class_ then failed validation unless by_name=True.

Consumed aliases are no longer stored as extras, and models can also be populated by field name. Dump now emits one key; dumped JSON round-trips.

Test plan

  • pytest tests/test_parse_response.py tests/test_models.py::test_aliased_field_not_duplicated_in_dump tests/test_models.py::test_validate_aliased_field_by_name

construct() was storing the API alias as an extra after filling class_, so model_dump_json emitted both keys and S3 JSON with class_ failed validation.
Copilot AI balanced review requested due to automatic review settings August 21, 2026 10:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

ParseResponse serialization duplicates keys

2 participants