GNOME Bugzilla – Bug 660935
Suggested improvements to JSON-glib documentation.
Last modified: 2017-09-05 10:38:58 UTC
Created attachment 198267 [details] Example source code to create a JSON object and then a JSON string. (1) I offer a small example code for the creation of a json object and the use of the generator to print it. You are free to do with it as you will. It is my own work which I, hereby, put into the public domain. I would hope it would find a place in the docs. I've run it through valgrind and think it doesn't leak, but as this is my example code I generated for learning purposes, I cannot guarantee it is correct. A review would be welcomed. (2) json_node_new () requires an object type. For complex types, the requisite object the node must contain is not created. It would be helpful to state that in the description of the function, perhaps with an example of creating a node containing an object. (3) Reference counting is noted in the json_node_take_object() and ...put_object() functions, but further clarification of the implication of this would be nice. Something like, "Use json_node_put_object() if you intend to use the object independently of this node. Decrement the reference count to the object when you no longer need it, otherwise use json_node_take_object() to cede management of the object to the node." (4) My experimentation revealed that the json_generator_set_root() did not behave well when passing an arbitrary node to the json_generator_set_root() function. If there is a requirement that the node be to a complex or object type, this should be noted. Otherwise, this may be a bug.
thanks for the suggestions. can you please turn all these suggestions into patches that I can review?
Can you point me to instructions as to how to create what you desire.
sure. JSON-GLib's documentation is inlined inside the source. JSON-GLib uses Git as the revision control system, so you'll have to learn how to clone the JSON-GLib repository and modify the documentation: http://live.gnome.org/Git/Developers if you want to test your changes, you'll have to build JSON-GLib; it's going to be easier to build it through JHBuild, the Gnome project build tool: http://live.gnome.org/Jhbuild if you have other issues, feel free to send an email to the gnome-love mailing list: http://mail.gnome.org/mailman/listinfo/gnome-love which is meant to be used by new contributors to get guidance and help.
(In reply to comment #2) > Can you point me to instructions as to how to create what you desire. Emmanuele, My previous comment seems a bit terse. I'm pleased to help in any way I can, but am unfamiliar with the process.
(In reply to comment #4) > (In reply to comment #2) > > Can you point me to instructions as to how to create what you desire. > > Emmanuele, > > My previous comment seems a bit terse. I'm pleased to help in any way I can, > but am unfamiliar with the process. Comments crossed in the mail. I'll review your suggestions. Thanks!
[Fixing Default QA assignee for json-glib - see 613232#c1. Sorry for bugmail noise.]
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/json-glib/issues/3.