fix(models): coerce numbers to strings by default
Metadata
Current evaluation
Merged #450 in dc1928f2, restoring numeric-to-string coercion in CraftBaseModel so numeric YAML values are accepted by string fields.
Resolution: closed resolved
Reason: PR #450 was approved and merged as commit dc1928f2. It enabled Pydantic's coerce_numbers_to_str option by default, resolving the validation failures reported in Snapcraft #4978 and #5017.
Evaluated by: mr-cal-bot
No scores available.
Issue body
As seen in:
https://github.com/canonical/snapcraft/issues/4978 https://github.com/canonical/snapcraft/issues/5017
- [ ] Have you followed the guidelines for contributing?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `tox`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged #450 in dc1928f2, restoring numeric-to-string coercion in CraftBaseModel so numeric YAML values are accepted by string fields. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/craft-application#450 (commit dc1928f2), restoring default numeric-to-string coercion in models to address snapcraft#4978 and #5017. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Coerces numbers to strings by default in models, resolving issues #4978 and #5017. Approved by two reviewers with passing CI checks. Adds 21 lines across two files. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/snapcraft#4978
(confidence 98%)
Downstream validation failure cited as motivation for the fix.
-
Related To:
canonical/snapcraft#5017
(confidence 98%)
Downstream validation failure cited as motivation for the fix.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #50 fix(models): coerce numbers to strings | craft-grammar | merged | Merged PR #50 as commit 3c244fa, restoring numeric-to-string coercion in model configurations across four files. | |
| #459 fix(models): coerce numbers to strings by default (#450) | craft-application | merged | Merged #450’s model fix in #459 (commit f175c968), restoring numeric-to-string coercion needed by downstream snapcraft#5017. | |
| #46 fix: coerce numbers to strings | craft-grammar | closed | Closed unmerged as ineffective; merged PR canonical/craft-grammar#50 restored numeric-to-string coercion in commit 3c244fa. |