Skip to content

Commit

Permalink
Fix schema validation for cards
Browse files Browse the repository at this point in the history
  • Loading branch information
sayden committed Oct 21, 2024
1 parent 6bbab54 commit d457895
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cards_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type CardsTemplate struct {
Scaling float64 `json:"scaling,omitempty" default:"1.0"`

Cards []Card `json:"cards"`
MaxCardsPerFile int `json:"max_cards_per_file"`
MaxCardsPerFile int `json:"max_cards_per_file,omitempty"`

Extra CardsExtra `json:",omitempty"`
}
Expand All @@ -40,7 +40,7 @@ type CardsExtra struct {
}

func ParseCardTemplate(byt []byte) (t *CardsTemplate, err error) {
if err = ValidateSchemaBytes[CounterTemplate](byt); err != nil {
if err = ValidateSchemaBytes[CardsTemplate](byt); err != nil {
return nil, errors.Wrap(err, "JSON file is not valid")
}

Expand Down

0 comments on commit d457895

Please sign in to comment.