-
Notifications
You must be signed in to change notification settings - Fork 237
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
"Merge Json" block #1609
Comments
This is not merging jsons, just looking at it this is a fancy way of joining them together. Merging jsons would be similar to merging folders - any keys would be set to the answer of that key plus the answer of another key, a lot like subdirectories. I suppose, however, that this would probably work for most purposes, as getting all keys of something would probably get the answers to multiple keys of the same name, so I may close this issue. |
Just testing it, if we try to get the value {"key":"value","badkey":"badvalue","key":"value2"} (I did not try merging, yet, this is just some proof testing) it will only give the value of the final key of that name - e.g if we try to get the value of "key" it will only give "value2". If we were to merge {"key":"value","badkey":"badvalue"} and {key:value2} it should result in {"key":"[value,value2]",badkey":"badvalue"} This would likely have to extend to subvalues, e.g {"key":{"inkey":"invalue"}} and {"key":{"inkey":"invalue2","otherkey":"othervalue"}} would merge to {"key":{"inkey":["invalue","invalue2"],"otherkey":"othervalue"}}. I'm not a real programmer by any means, I'm not even that great at turbowarp, but this seems like something that most json libraries (I think that's the right term but probably not) would have already. This may be too hyper specific to add to an extension and if it is, I completely understand. There are multiple issues such as how to hand true/false, weather or not to merge into an array or keep one value, and probably more I haven't thought of. |
I know OP already assessed that this isn't the function they were thinking of, but this still feels like a rather roundabout solution for something that should be simple. Perhaps another issue regarding this topic is in order. |
It is included in v2.6 but haven't merged yet :( |
just not the simplest thing to set up. and you need to know js |
We should implement a "merge json" block, which would do as the name entails. You would probably have to pick between allowing duplicates or not, and maybe an input for how "deep" you would want it. Also, before anyone says you could already achieve this with custom reporters, you can technically do the entire json extension with custom reporters so that's not really a valid arguement
The text was updated successfully, but these errors were encountered: