-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to encode value keys with '.' separators #229
base: main
Are you sure you want to change the base?
Conversation
An Encoder can has the option to separate the names of nested structs with a period when it constructs the values key during encoding.
Make verify seems to fail due to some linter problems due to integer overflow conversions |
Looks good overall. If I may be a bit picky, I believe we could find a name which is semantically better for the option. I am thinking about something like: Also, I believe the |
@zak905 Thanks for the feedback. I have changed the name of the option to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for addressing the remark.
Waiting on @jaitaiwan feedback.
Description
The
Encoder
struct has now a method calledActivateKeySeparation
.When this option is activated the keys of the
values map[string][]string
will be the full path containing all names of the nested struct fields separated
by a period (
.
).This also fixes the bug referenced in #228 that it is currently not possible to
decode values into structs with nested fields after encoding said structs.
I'm not sure about the naming so I'm open for suggestions if someone has better ideas.
Example
What type of PR is this? (check all applicable)
Description
Related Tickets & Documents
Added/updated tests?
have not been included
Run verifications and test
make verify
is passingmake test
is passing