Skip to content

fix: handle incorrect string type for nested strcuts#65

Open
steveiliop56 wants to merge 1 commit intotraefik:masterfrom
steveiliop56:fix/nested-maps
Open

fix: handle incorrect string type for nested strcuts#65
steveiliop56 wants to merge 1 commit intotraefik:masterfrom
steveiliop56:fix/nested-maps

Conversation

@steveiliop56
Copy link
Copy Markdown

For some reason, when I used nested structs, so something like this:

type Yoyo struct {
    Yoyo map[string]Yaya
}

type Yaya struct {
    Foo Fooya
}

type Fooya struct {
    Bar string
}

And then an environment variable like this:

TRAEFIK_YOYO_NAME_FOO_BAR=bar

The parser would fail to walk through the struct saying that it expected a struct instead of a string. This change (although a bit junky), forces the struct type on the field if the node has children, essentially allowing the parsing to proceed and the decode to work.

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