Skip to content

loader: replace environment variables before JSON unmarshalling#19

Merged
abraithwaite merged 1 commit intomainfrom
alan/loader-json
Sep 7, 2025
Merged

loader: replace environment variables before JSON unmarshalling#19
abraithwaite merged 1 commit intomainfrom
alan/loader-json

Conversation

@abraithwaite
Copy link
Member

Summary

  • Updates LoadConfig to replace environment variables in raw JSON before unmarshalling instead of using reflection afterward
  • Fixes environment variable processing for nested loaders with interface types
  • Uses Go's json.Marshal for proper JSON escaping of special characters

Updates LoadConfig to replace environment variables in the raw JSON string
before unmarshalling instead of using reflection after unmarshalling.
This fixes an issue where nested loaders with interface types couldn't
have their environment variables processed correctly.

Environment variable values are properly escaped using Go's json.Marshal
to ensure JSON structure integrity when values contain quotes, backslashes,
or other special characters.

Adds comprehensive tests for environment variable replacement and JSON escaping.
@abraithwaite abraithwaite merged commit d96a7be into main Sep 7, 2025
1 check failed
@abraithwaite abraithwaite deleted the alan/loader-json branch September 7, 2025 19:59
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