Add accessors for bson.D

This commit is contained in:
George Suntres
2026-04-17 20:41:21 -04:00
parent 7a6c5b6c3c
commit f52793a764
2 changed files with 34 additions and 1 deletions

View File

@@ -11,8 +11,10 @@ import (
func Validate(schema string, dataAny any) error {
data := StructToMapRecursive(dataAny)
content := []byte(schema)
var v any
if err := json.Unmarshal([]byte(schema), &v); err != nil {
if err := json.Unmarshal(content, &v); err != nil {
log.Printf("Failed to decode json %#v", err)
return err