required tag not being honoured
- Dominant language
- Go
- Stars
- 507
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
I created a config struct like this
```
type rabbitMQ struct {
USER string `config:"user,required"`
PASSWORD string `config:"password,required"`
HOST string `config:"host"`
PORT string `config:"port"`
}
type dbConfig struct {
DIALECT string `config:"dialect,required"`
NAME string `config:"name,required"`
USER string `config:"user,required"`
PASSWORD string `config:"password,required"`
HOST string `config:"host"`
PORT string `config:"port"`
}
type Config struct {
DATABASES map[string]dbConfig `config:"databases,required"`
RABBITMQ rabbitMQ `config:"rabbitmq,required"`
ENVIRONMENT string `config:"environment"`
}
```
confita seems to be ignoring the required tag for all but the password field in the rabbitMQ config
The file I'm reading from is a yaml file
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue with the shown Go config structs and a YAML file that omits each field marked required. Trace how the required tags are processed during YAML loading; done means every missing required field is rejected consistently, not only the password field.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100