Skip to content

Commit

Permalink
Add public method to get supplied context.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenea committed Sep 26, 2024
1 parent 431e385 commit 5326189
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (ctx CompilerContext) GetResourceSchema() *Schema {

// ValidationContext provides additional context required in validating for extension.
type ValidationContext struct {
ctx context.Context
externalContext context.Context
result validationResult
doc interface{}
vloc string
Expand Down Expand Up @@ -146,6 +146,11 @@ func (ctx ValidationContext) GetParent() ParentDescriptor {
return ctx.parent
}

// GetExternalContext returns the external context supplied by user.
func (ctx ValidationContext) GetExternalContext() context.Context {
return ctx.externalContext
}

// Group is used by extensions to group multiple errors as causes to parent error.
// This is useful in implementing keywords like allOf where each schema specified
// in allOf can result a validationError.
Expand Down

0 comments on commit 5326189

Please sign in to comment.