-
Notifications
You must be signed in to change notification settings - Fork 55
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
[FEAT] Support Set with Slice (Array) Index Using Square Brackets? #96
Comments
Has been implemented, the next version will be released. |
Glad to hear!!! |
hi, new version has been released. https://github.com/gookit/config/releases/tag/v2.1.4 |
@inhere {
"parent": [
{
"child1Field1": 1,
"child1Field2": 2
},
{
"child2Field1": 3,
"child2Field2": 4
}
]
} When I do {
"parent": [
{
"child1Field1": 1,
"child1Field2": 2
},
{
"child2Field1": 3,
"child2Field2": 4
}
],
"parent[0]": {
"child1Field1": 5
}
} Expecting result: {
"parent": [
{
"child1Field1": 5,
"child1Field2": 2
},
{
"child2Field1": 3,
"child2Field2": 4
}
]
} Can you also implement to support this? |
This must be a bug or something. I noticed we can do this, but only the second time on. (ONLY when the JSON file doesn't contain these config yet) {
[...]
"parent[0]": {
"child1Field1": 5
}
} But call the second time it would be correct: {
[...]
"parent": { //When calling the second time and so on...
[...]
{
"child1Field1": 5,
[...]
}
},
"parent[0]": { //When calling the first time
"child1Field1": 5
}
} And when I reload the program and keep those config in the JSON file to be loaded. I will get this error after call:
Any idea? |
Any update on this? |
:( I've been quite busy lately, so no updates. |
It would be nice to support slice index in
.Set()
Example:
Currently, the result will be like:
==> Expecting result would look like:
Thanks,
The text was updated successfully, but these errors were encountered: