diff --git a/controllers/accounts.go b/controllers/accounts.go index cec4c5a..1ef451e 100644 --- a/controllers/accounts.go +++ b/controllers/accounts.go @@ -64,7 +64,7 @@ func unmarshalToAccount(r *http.Request, account *models.Account) error { if err != nil { return err } - var validKey = regexp.MustCompile(`^[a-z_A-Z]+$`) + var validKey = regexp.MustCompile(`^[a-z_A-Z0-9]+$`) for key := range account.Data { if !validKey.MatchString(key) { return fmt.Errorf("Invalid key in data json: %v", key) diff --git a/controllers/transactions.go b/controllers/transactions.go index 2d3fb5e..34e39ce 100644 --- a/controllers/transactions.go +++ b/controllers/transactions.go @@ -23,7 +23,7 @@ func unmarshalToTransaction(r *http.Request, txn *models.Transaction) error { if err != nil { return err } - var validKey = regexp.MustCompile(`^[a-z_A-Z]+$`) + var validKey = regexp.MustCompile(`^[a-z_A-Z0-9]+$`) for key := range txn.Data { if !validKey.MatchString(key) { return fmt.Errorf("Invalid key in data json: %v", key)