After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660935 - Suggested improvements to JSON-glib documentation.
Suggested improvements to JSON-glib documentation.
Status: RESOLVED OBSOLETE
Product: json-glib
Classification: Core
Component: Core
0.14.x
Other Linux
: Normal enhancement
: ---
Assigned To: json-glib-maint
json-glib-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-04 21:56 UTC by John Navratil
Modified: 2017-09-05 10:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example source code to create a JSON object and then a JSON string. (1.70 KB, text/x-csrc)
2011-10-04 21:56 UTC, John Navratil
Details

Description John Navratil 2011-10-04 21:56:10 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.
Comment 1 Emmanuele Bassi (:ebassi) 2011-10-17 10:22:56 UTC
thanks for the suggestions.

can you please turn all these suggestions into patches that I can review?
Comment 2 John Navratil 2011-10-17 13:16:48 UTC
Can you point me to instructions as to how to create what you desire.
Comment 3 Emmanuele Bassi (:ebassi) 2011-10-17 15:16:39 UTC
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.
Comment 4 John Navratil 2011-10-17 15:38:38 UTC
(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.
Comment 5 John Navratil 2011-10-17 15:39:16 UTC
(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!
Comment 6 André Klapper 2012-03-13 22:08:40 UTC
[Fixing Default QA assignee for json-glib - see 613232#c1. Sorry for bugmail noise.]
Comment 7 Emmanuele Bassi (:ebassi) 2017-09-05 10:38:58 UTC
-- 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.