mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-05-04 08:39:36 -05:00
5bf9f97720
* feat: add helper method to repository * feat: 400 on event pushes with invalid payloads * fix: pointer * feat: add to trigger * feat: error on bulk trigger * feat: error on schedule * fix: validate log lines * feat: validate crons * feat: fail the task * fix: rm debug line
19 lines
317 B
Go
19 lines
317 B
Go
package repository
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
func ValidateJSONB(jsonb []byte, fieldName string) error {
|
|
if len(jsonb) == 0 {
|
|
return nil
|
|
}
|
|
|
|
if strings.Contains(string(jsonb), "\\u0000") {
|
|
return fmt.Errorf("encoded jsonb contains invalid null character \\u0000 in field `%s`", fieldName)
|
|
}
|
|
|
|
return nil
|
|
}
|