Implementing WISHLIST.md items #1, #2, and #4 (removing #3 since yapi send already exists).
Remove item #3 (yapi send) since it's already shipped.
The problem: $step.field (no braces) silently passes as a literal string instead of being substituted. Only ${step.field} works.
Changes:
cli/internal/vars/vars.go: Add aBareChainRefregex that matches$word.wordpatterns that are NOT inside${...}.cli/internal/vars/vars.go: AddFindBareRefs(s string) []stringthat returns the bare refs found.cli/internal/validation/analyzer.go: InanalyzeParsed(), call a newwarnBareChainRefs(text)validation function that scans the raw YAML text for bare$word.wordpatterns and emitsSeverityWarningdiagnostics with line numbers and an actionable message like:"possible bare variable reference '$step.field' -- did you mean '${step.field}'? Only the ${...} form is substituted."
This catches the problem at config analysis time (before execution), so users see the warning immediately -- even in yapi validate.
The problem: When a chain step fails, you can't see what values were actually sent because variable substitution is invisible.
Changes:
cli/internal/runner/runner.go: AddVerbose boolfield torunner.Options.cli/internal/runner/runner.go: InRunChain(), afterinterpolateConfig()succeeds and before executing, ifopts.Verboseis true, print the resolved config to stderr:- Resolved URL (with method)
- Resolved headers
- Resolved body (JSON-serialized if map, or raw if string)
- Uses
fmt.Fprintf(os.Stderr, ...)with[VERBOSE]prefix, consistent with the existing Logger pattern.
cli/cmd/yapi/run.go: Setopts.Verbose = ctx.verbosewhen building runner.Options inexecuteRunE().
The problem: In chain execution, you only see the final failing step's output, not intermediate step responses.
Changes:
-
cli/internal/runner/runner.go: InRunChain(), after each step executes, ifopts.Verboseis true, print the step's response details to stderr:- Status code
- Response body (truncated at 1000 chars for readability)
- Duration
This replaces the need for a per-step
debug: truefield -- verbose mode shows everything, which is simpler and avoids new config surface area.
Create example .yapi.yml files that demonstrate the improved debugging experience:
bare-variable-warning.yapi.yml: A chain that uses$step.field(bare) to trigger the new warning.chain-verbose-demo.yapi.yml: A multi-step chain against jsonplaceholder with variables that shows how--verbosereveals resolved values.assertion-failure-demo.yapi.yml: A request with anexpect:block that will fail, showing the detailed assertion error output.missing-key-demo.yapi.yml: A chain that references a nonexistent JSON key, showing the precise error path.
| File | Change |
|---|---|
WISHLIST.md |
Remove item #3 |
cli/internal/vars/vars.go |
Add BareChainRef regex + FindBareRefs() function |
cli/internal/validation/analyzer.go |
Add warnBareChainRefs(), call from analyzeParsed() |
cli/internal/runner/runner.go |
Add Verbose to Options, add verbose logging in RunChain() |
cli/cmd/yapi/run.go |
Thread verbose into runner.Options |
examples/debugging/*.yapi.yml |
4 new example files |
No new dependencies. No config schema changes. No breaking changes.