MCPcopy Create free account
hub / github.com/docker/docker-agent / yamlNodeToValue

Function yamlNodeToValue

pkg/tools/builtin/openapi/openapi.go:402–408  ·  view source on GitHub ↗

yamlNodeToValue converts a yaml.Node to a native Go value, preserving the original type (int, float, bool, null) instead of returning everything as a string.

(node *yaml.Node)

Source from the content-addressed store, hash-verified

400// original type (int, float, bool, null) instead of returning everything as a
401// string.
402func yamlNodeToValue(node *yaml.Node) any {
403 var v any
404 if err := node.Decode(&v); err != nil {
405 return node.Value
406 }
407 return v
408}
409
410// sanitizeToolName converts a string into a valid tool name.
411func sanitizeToolName(name string) string {

Callers 1

schemaProxyToPropertyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected