MCPcopy Create free account
hub / github.com/github/gh-aw / validateParamValue

Function validateParamValue

pkg/workflow/model_identifier.go:343–353  ·  view source on GitHub ↗

validateParamValue validates a parameter value per the ABNF grammar.

(value string)

Source from the content-addressed store, hash-verified

341
342// validateParamValue validates a parameter value per the ABNF grammar.
343func validateParamValue(value string) error {
344 if value == "" {
345 return errors.New("model identifier: parameter value must not be empty (segment type: parameter value)")
346 }
347 if !reParamValue.MatchString(value) {
348 if r := firstForbiddenCharInParamValue(value); r != 0 {
349 return fmt.Errorf("model identifier: character %q is not allowed in parameter value %q (segment type: parameter value)", r, value)
350 }
351 }
352 return nil
353}
354
355// UnrecognizedParams returns the list of parameter keys in params that are not
356// defined in Section 6 (i.e., not effort or temperature).

Callers 1

parseQueryStringFunction · 0.85

Calls 2

ErrorfMethod · 0.45

Tested by

no test coverage detected