Skip to content

Reject a computed field argument default its type cannot represent - #314

Merged
TomHAnderson merged 1 commit into
API-Skeletons:14.0.xfrom
TomHAnderson:hotfix/computed-argument-defaults
Oct 3, 2026
Merged

TomHAnderson merged 1 commit into
API-Skeletons:14.0.xfrom
TomHAnderson:hotfix/computed-argument-defaults

Conversation

@TomHAnderson

Copy link
Copy Markdown
Member

A scalar default on an argument whose type the attribute's args give, such as '2020-01-01' for a date_immutable argument, passed the metadata checks. Printing the schema then threw, introspection failed at the argument's defaultValue, and the method was given the raw default rather than a value of the type.

When the type is built, a default must now be a value of the argument's type: a scalar or enum type which serializes it. Otherwise Exception\Metadata names the argument, its default and its type.

A scalar default on an argument whose type the attribute's args give,
such as '2020-01-01' for a date_immutable argument, passed the metadata
checks.  Printing the schema then threw, introspection failed at the
argument's defaultValue, and the method was given the raw default rather
than a value of the type.

When the type is built, a default must now be a value of the argument's
type: a scalar or enum type which serializes it.  Otherwise
Exception\Metadata names the argument, its default and its type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d0d61f0) to head (429d6c0).
⚠️ Report is 1 commits behind head on 14.0.x.

Additional details and impacted files
@@             Coverage Diff             @@
##              14.0.x      #314   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity      1191      1195    +4     
===========================================
  Files             80        80           
  Lines           3213      3227   +14     
===========================================
+ Hits            3213      3227   +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TomHAnderson
TomHAnderson merged commit 565888a into API-Skeletons:14.0.x Oct 3, 2026
13 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.

1 participant