Skip to content

Commit

Permalink
ext/validate: add ValueLocation method
Browse files Browse the repository at this point in the history
  • Loading branch information
santhosh-tekuri committed Jul 30, 2024
1 parent 89d3b9e commit 055b208
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vocab.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ type ValidatorContext struct {
vd *validator
}

// ValueLocation returns location of value as jsonpath token array.
func (ctx *ValidatorContext) ValueLocation() []string {
return ctx.vd.vloc
}

// Validate validates v with sch. vpath gives path of v from current context value.
func (ctx *ValidatorContext) Validate(sch *Schema, v any, vpath []string) error {
switch len(vpath) {
Expand Down

0 comments on commit 055b208

Please sign in to comment.