Skip to content

feat: support string map values from config sources#50

Open
happysnaker wants to merge 1 commit into
urfave:mainfrom
happysnaker:feat-stringmap-value-source
Open

feat: support string map values from config sources#50
happysnaker wants to merge 1 commit into
urfave:mainfrom
happysnaker:feat-stringmap-value-source

Conversation

@happysnaker

Copy link
Copy Markdown

Summary

  • serialize map values with cli.NewStringMap(...).Serialize() in ValueSource.Lookup
  • preserve existing slice/scalar behavior
  • add JSON/YAML/TOML coverage for StringMapFlag-compatible values

Why

cli-altsrc could already source scalar and slice values from config files, but object/map values were stringified with fmt.Sprintf, which is not compatible with urfave/cli/v3 StringMapFlag parsing. This change makes config-backed map values round-trip through the same serialized format used by cli.NewStringMap.

Notes

  • no behavior change for scalar or slice lookups
  • added format coverage for JSON, YAML, and TOML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant