← Back to issue list

[Pydantic 2] Use the error's `input` when formatting validation messages

View original Github issue

Metadata

Project
craft-application
Number
#158
Type
issue
State
closed
Author
tigarmo
Labels
—
Created
Updated
Closed

Current evaluation

Resolved by merged PR #927 (commit d480b8fe), which formats Pydantic validation errors with the failed input value.

Resolution: closed resolved

Reason: Issue #158 is recorded as fixed by merged PR #927. Commit d480b8fe updated error formatting to read error["input"] and include that value in validation messages.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### What needs to get done Pydantic 2's `ErrorDict` includes an `input` key that holds the value that failed to validate. Once we update from Pydantic 1 we should use this new field in our validation failure messages. Ref: https://github.com/canonical/craft-application/pull/156 ### Why it needs to get done To provide clearer messages!

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Resolved by merged PR #927 (commit d480b8fe), which formats Pydantic validation errors with the failed input value.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #927 (commit d480b8fe), which added Pydantic's failing input value to validation error messages.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #927 (commit d480b8fe), which added Pydantic error input values to validation messages and resolved #158 (CRAFT-2611).
qwen/qwen3.6-35b-a3b — — Closed without explicit resolution. The task to integrate Pydantic 2's input field into validation error messages was not addressed and appears abandoned or superseded.
qwen/qwen3.6-35b-a3b — — Closed without implementation. The request to use Pydantic 2's input field for validation messages appears abandoned or completed via the referenced PR, with no further activity recorded.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-application#927 (confidence 100%)

    Merged fix that added Pydantic error input values to validation messages.

  • Related To: canonical/craft-application#156 (confidence 80%)

    Earlier PR referenced by #158 that introduced the validation-error customization hook used by the project.

Related issues

No related issues found above the similarity threshold.