Repository navigation
refactor: derive camelCase model aliases with an alias generator - #2319
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #2319 +/- ##
=====================================
Coverage ? 94.00%
=====================================
Files ? 183
Lines ? 13570
Branches ? 0
=====================================
Hits ? 12757
Misses ? 813
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
added a commit
that referenced
this pull request
Oct 16, 2026
Models with camelCase external keys now set `alias_generator=to_camel` in their `model_config`, next to the existing `validate_by_name`/`validate_by_alias`, so their aliases are derived from the field names. Over 90 hand-written `Field(alias=...)` entries go away. An explicit alias stays only where the key differs from the generated one, such as `crawlerRuntimeMillis`, `requestId`, `timeRemainingSecs`, `sitemapCompleted`, the snake_case adaptive statistics fields and `session_id`. The wire format doesn't change. A dump of the effective alias of every field and computed field across all 40 models is identical before and after. The only behavioural difference is that `CrawleeRequestData` now also accepts field names on validation, as the other models already do. Closes: #1954 *✍️ Drafted by Claude Code*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Models with camelCase external keys now set
alias_generator=to_camelin theirmodel_config, next to the existingvalidate_by_name/validate_by_alias, so their aliases are derived from the field names. Over 90 hand-writtenField(alias=...)entries go away. An explicit alias stays only where the key differs from the generated one, such ascrawlerRuntimeMillis,requestId,timeRemainingSecs,sitemapCompleted, the snake_case adaptive statistics fields andsession_id.The wire format doesn't change. A dump of the effective alias of every field and computed field across all 40 models is identical before and after. The only behavioural difference is that
CrawleeRequestDatanow also accepts field names on validation, as the other models already do.Closes: #1954
✍️ Drafted by Claude Code