heetch / heetch/confita

Support type field `map` during pass through env variable

Open
#103 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
507
Forks
49
PR merge metrics
No merged PRs in 30d

Description

## Problem
Confita doesn't support map types when loading from environment variables:

```
type Config struct {
Settings map[string][]int `config:"settings"`
}
```

## Current error
```
Error: failed to parse config: field type 'map' not supported
```

## Proposal
Add support for maps by parsing JSON from env variables:

```bash
export SETTINGS='{"key1":[1,2,3],"key2":[4,5,6]}'
export ACT_RECEIPT_UZ_ALLOWED_INVOICE_PAYMENT_METHODS_BY_SERVICES='{7: [1101], 37: [1101], 671: [1101]}'
```

## Benefits
- More flexible configuration options
- Support for complex nested structures
- Consistency with other config libraries (viper, envconfig)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the environment-variable backend and its existing field-type parsing, then trace how unsupported map fields produce the reported error. Add coverage for the shown map[string][]int configuration and verify that valid JSON from an environment variable is decoded into the map without breaking existing types.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.