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 779464 - json-node: Clarify documentation on JsonNode getters for other types
json-node: Clarify documentation on JsonNode getters for other types
Status: RESOLVED FIXED
Product: json-glib
Classification: Core
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: json-glib-maint
json-glib-maint
Depends on:
Blocks:
 
 
Reported: 2017-03-02 10:39 UTC by Philip Withnall
Modified: 2017-03-02 12:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
json-node: Clarify documentation on JsonNode getters for other types (5.51 KB, patch)
2017-03-02 10:39 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2017-03-02 10:39:45 UTC
Trivial patch attached.
Comment 1 Philip Withnall 2017-03-02 10:39:48 UTC
Created attachment 347042 [details] [review]
json-node: Clarify documentation on JsonNode getters for other types

Clarify in the documentation what each of the JsonNode getters when
called on a node which contains a value whose type is not what the
caller expects (since this behaviour is well-defined in the code).

Inspired by http://stackoverflow.com/q/42081921/2931197.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Emmanuele Bassi (:ebassi) 2017-03-02 11:33:43 UTC
Review of attachment 347042 [details] [review]:

Looks like a good improvement. Just a minor issue on the annotations…

::: json-glib/json-node.c
@@ +557,2 @@
  *
  * Return value: (transfer none): the #JsonObject

Shouldn't the annotation be updated to include (nullable) here as well?

@@ +576,2 @@
  *
  * Return value: (transfer full): the #JsonObject

Same as above.

@@ +650,2 @@
  *
  * Return value: (transfer none): the #JsonArray

Same as above.

@@ +669,2 @@
  *
  * Return value: (transfer full): the #JsonArray with its reference

Same as above.

@@ +999,2 @@
  *
  * Return value: a string value.

Same as above.

@@ +1022,2 @@
  *
  * Return value: (transfer full): a newly allocated string containing a copy

Same as above.
Comment 3 Philip Withnall 2017-03-02 12:12:09 UTC
Good point, pushed with the annotations added. Thanks.

Attachment 347042 [details] pushed as 011c1e4 - json-node: Clarify documentation on JsonNode getters for other types