MCPcopy Create free account
hub / github.com/Xenov-X/csbot / validateVariables

Method validateVariables

workflow/validator.go:82–105  ·  view source on GitHub ↗

validateVariables checks for valid variable names and potential conflicts

(wf *Workflow)

Source from the content-addressed store, hash-verified

80
81// validateVariables checks for valid variable names and potential conflicts
82func (v *Validator) validateVariables(wf *Workflow) []ValidationError {
83 var errors []ValidationError
84
85 for varName := range wf.Variables {
86 // Check for reserved prefixes
87 if strings.HasPrefix(varName, "beacon.") {
88 errors = append(errors, ValidationError{
89 Type: "variable",
90 Message: fmt.Sprintf("variable name '%s' conflicts with reserved 'beacon.' prefix", varName),
91 Severity: "warning",
92 })
93 }
94
95 // Check for empty variable names
96 if strings.TrimSpace(varName) == "" {
97 errors = append(errors, ValidationError{
98 Type: "variable",
99 Message: "variable name cannot be empty",
100 })
101 }
102 }
103
104 return errors
105}
106
107// validateAction validates a single action
108func (v *Validator) validateAction(action Action, index int, seenNames map[string]bool) []ValidationError {

Callers 1

ValidateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected