-
Notifications
You must be signed in to change notification settings - Fork 21
Clarify JSON vs TOML variable expansion semantics in configuration docs #4210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -135,7 +135,8 @@ Run `./awmg --help` for full CLI options. Key flags: | |||||||||
| - **`env`** (optional): Environment variables | ||||||||||
| - Set to `""` (empty string) for passthrough from host environment | ||||||||||
| - Set to `"value"` for explicit value | ||||||||||
| - Use `"${VAR_NAME}"` for environment variable expansion (fails if undefined) | ||||||||||
| - Use `"${VAR_NAME}"` for environment variable expansion (JSON stdin format only; fails if undefined) | ||||||||||
| - **TOML note**: For passthrough, use `""` (empty string) or provide explicit values; `${VAR_NAME}` syntax is not expanded in TOML server `env` values | ||||||||||
|
|
||||||||||
| - **`url`** (required for http): HTTP endpoint URL for `type: "http"` servers | ||||||||||
|
|
||||||||||
|
|
@@ -353,11 +354,14 @@ The `customSchemas` top-level field allows you to define custom server types bey | |||||||||
| - **Stdio servers** must specify `container` (required) | ||||||||||
| - **HTTP servers** must specify `url` (required) | ||||||||||
| - **The `command` field is not supported** - stdio servers must use `container` | ||||||||||
| - Variable expansion with `${VAR_NAME}` is applied globally (all fields are expanded before parsing) and fails fast on undefined variables | ||||||||||
| - **TOML format**: | ||||||||||
| - Uses `command` and `args` fields directly (e.g., `command = "docker"`) | ||||||||||
| - Variable expansion with `${VAR_NAME}` is only supported in `[gateway.opentelemetry]` and legacy `[gateway.tracing]` fields | ||||||||||
| - Server `env` values, `url`, `args`, `gateway.api_key`, and other non-tracing fields are not expanded | ||||||||||
|
Comment on lines
+360
to
+361
|
||||||||||
| - Variable expansion with `${VAR_NAME}` is only supported in `[gateway.opentelemetry]` and legacy `[gateway.tracing]` fields | |
| - Server `env` values, `url`, `args`, `gateway.api_key`, and other non-tracing fields are not expanded | |
| - Variable expansion with `${VAR_NAME}` is only supported in `[gateway.opentelemetry]` fields | |
| - Server `env` values, `url`, `args`, `gateway.api_key`, legacy `[gateway.tracing]`, and other non-opentelemetry fields are not expanded |
Copilot
AI
Apr 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After stating that TOML does not expand ${VAR_NAME} in non-tracing fields, this doc still contains other TOML-relevant examples that suggest ${VAR} works (e.g., mounts source description and the gateway.domain row). To avoid contradictory guidance, consider updating those references to be JSON-only / tracing-only (or otherwise scoping them) so the file is internally consistent.
| - For host environment passthrough to container `env`, use an empty string `""` value | |
| - For host environment passthrough to container `env` in TOML, use an empty string `""` value; do not use `${VAR_NAME}` in `env` because non-tracing TOML fields are not expanded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TOML guidance here implies that setting a server
envvalue to an empty string provides passthrough from the host env. In the TOML (file) path,[servers.<name>.env]is passed as process environment for the backend command (e.g., thedockerCLI), soKEY = ""will setKEYto an empty value (overriding host), not passthrough. To pass a host env var into a Docker container from TOML, useargswith-e KEYand ensureKEYis present in the gateway process environment (or set an explicit value in[servers.<name>.env]).This issue also appears on line 361 of the same file.
See below for a potential fix: