Add validation on card metadata types #518
No reviewers
Labels
No labels
blocked
duplicate
needs
approval
needs
criteria
needs
estimate
needs
tests
question
step
doing
step
review
step
testing
step
todo
step
uat
type
admin
type
alert
type
bug
type
change
type
defect
type
epic
type
idea
type
incident
type
investigation
type
spike
type
story
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
External/card-drop!518
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/516-validate-card-metadata-types"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#516
WIP: Add validation on card metadata typesto Add validation on card metadata typesApprove — parse-time card metadata validation is well implemented and matches #516.
What looks good
CardMetadataValidatorenforces the right policy:typemust be a JSON number in theCardRarityrange (string"1"is rejected, not coerced), while seriesidnumeric strings are coerced for legacy files.CardMetadataFunctiontreats validation failures like corrupt JSON — logs the file path, aborts that load, and activates safe mode so invalid cards never reach drop/inventory/stats paths.type, rejected string/null/garbage/out-of-range types, series id coercion, and non-array roots.docs/cards.mddocuments the validation policy clearly.Non-blocking
CardMetadataFunctionend-to-end with a bad file on disk; validator coverage is thorough enough for now.cardsarray passes validation; fine if that is intentional.No merge-blocking issues.