Preflight Checklist

  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.
  • [x] I am not looking for support or already pursued the available support channels without success.
  • [x] I have checked the troubleshooting guide for my problem, without success.

Viper Version

1.21.0

Go Version

1.24

Config Source

Remove K/V stores

Format

YAML

Repl.it link

No response

Code reproducing the issue

https://github.com/spf13/viper/blob/e66ee1a10ee0208482d1de34282b537c34bb632c/viper.go#L1250-L1266

Expected Behavior

The same unmarshal key behaviour between local and remote config.

Actual Behavior

unmarshal from remote config (kvstore) using searchMap which can't get value from slice index key path.

Steps To Reproduce

array:
 - a
 - b
viper.Get("array.0") // local config get value 'a'
viper.Get("array.0") // remote config get value nil

Additional Information

No response