Luciana Lima Brito writes: > I'm lubrito on Guix IRC, the Outreachy applicant. > > I'm working on the json output for the render-compare/derivation > procedure (controller.scm). Hi lubrito, Good to hear from you. > I would like to know if I am on the right path with what I've > accomplished until now. You've got some JSON being rendered, so you're definitely on the right path :) > The attached .ppm file shows the json I have so far. The json is > showing only the data for the "outputs", but I already got the data for > the rest and I could do the same to them. I am still thinking about how > to make the code cleaner, because the way I'm doing could produce many > redundancies. > > I also would like to know if the general structure of the json is > correct or if it should be different. For example, under "outputs" "0" > is denoting base and "1" is denoting target. > > The current code for the function is here http://sprunge.us/mKkzX2 So, there's no "correct" structure for the JSON, but some structures might better represent the data than others, there's a number of factors to balance. I think an object with base and target names would easier to understand than using an array. Some of the types in the JSON are a bit off as well, part of this is the query processing is not working quite right, but that's a different issue. For the JSON you've got so far, I'd specifically look at the hash, hash-algorithm and recursive fields. hash and hash-algorithm are only set for some outputs (only for fixed output derivations), it would probably be better to have these fields set to null if they don't have a string value, or not included in the object. For recursive, that's a boolean, so it should be a boolean in the JSON too. Hope that helps! Chris