expandEnv replaces ${VAR} placeholders with their environment values. Missing variables expand to empty string — we don't fail the whole load on a single missing credential because operations without credentials should still appear in the registry (they'll just fail at call time).
(s string)
| 135 | // on a single missing credential because operations without credentials |
| 136 | // should still appear in the registry (they'll just fail at call time). |
| 137 | func expandEnv(s string) string { |
| 138 | return envVarPattern.ReplaceAllStringFunc(s, func(match string) string { |
| 139 | name := match[2 : len(match)-1] |
| 140 | return os.Getenv(name) |
| 141 | }) |
| 142 | } |
| 143 | |
| 144 | // canonicaliseOpKeys rewrites user-supplied Joins/Operations map keys |
| 145 | // to match the spec's actual operationId casing. Viper lowercases all |
no outgoing calls