| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
We should not warn when asking for a string, array or object if the
contents were 'null'.
(cherry picked from commit 3f8c8f99126dc1a70d847eded13afd4b64395250)
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| |
|
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=615799
(cherry picked from commit fcd07918d3ed2b31b047900da9d2fed23dddf7da)
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| |
|
|
|
|
|
| |
There is no such thing as a 'JsonArrary' type.
(cherry picked from commit 28edd58ddfd719d107d89aa364dc208b0126c90f)
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The array and object parsing logic in JsonParser has clearly exploded
beyond control: a simple tightening of the JSON validation almost broke
the parser in two. It it is time to...
<cue Christopher Lee voice-over>
REFACTOR THE CODE!
</cue Christopher Lee voice-over>
This time, we should be following the JSON state machine and try to do
more prediction of the next state based on peeking the next token.
The code is fairly cleaner, now; and, most of all, still passes the
validation test suite - which is, you know... nice.
(cherry picked from commit 08cec3b7c9202007a5abbf548f8d2f1b54d4d0b4)
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| |
|
|
|
|
|
|
| |
We are now using bugzilla.gnome.org, since we're already hosted on
git.gnome.org.
(cherry picked from commit 9d7c58b4fb5edeb8e9413acc9d509447e13962e5)
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
I should read the documentation for the functions I use:
Converts a gdouble to a string, using the '.' as decimal point. To
format the number you pass in a printf()-style format string. Allowed
conversion specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'.
-- from g_ascii_formatd() in GLib's API reference
Epic reading fail.
(cherry picked from commit f622ee8d8ba54ddea6fbb7311a905ffab7842e8d)
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| |
|
|
|
|
| |
(cherry picked from commit 88ac0d5111eb528e4c396e4c169ceee4fb046e62)
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| |
|
|
|
|
|
| |
Verify that invalid JSON will trigger a parser error.
(cherry picked from commit c22c1151e418af9506547804d4bc9fddb60bc0f1)
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| |
|
|
|
|
|
|
|
| |
Apparently, some breakage crept in JsonParser which allowed invalid JSON
to actually pass. For instance: trailing and missing commas, invalid
barewords and wrong array and object closing braces.
(cherry picked from commit 26668fe238a52a7fd8374f409fc277aaa8efa826)
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
The registration function for serialization and deserialization has been
replaced by two separate functions before releasing 0.10, but I forgot to
update the example in the documentation.
(cherry picked from commit ea666891cb1e6fc9e527ce6c93a306bc97145f16)
|
| |
|
|
|
|
| |
We create JsonObject structures using g_slice_new(), so we need to
initialize every member of the structure ourselves.
(cherry picked from commit c09c2dc1c54c83fea4ef93486081fe3fab35452c)
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Here's a small patch for json-glib, to fix some gcc warnings breaking
the build with -Werror (gcc can't know if the variable will get
initialized or not). I didn't find a product for json-glib in bugzilla,
but I guess a mail will work ;-)
Happy holidays :-)
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Make the output of the summary a little bit nicer.
|
| |
|
|
|
| |
We should require at least 0.6.4 for GObject-Introspection, since that
version allows us to pass the .la file to g-ir-scanner.
|
| |
|
|
|
|
| |
gtk-doc complains that the argument name in the header does not match
the one in the documentation annotation for the GBoxed deserialization
function registration.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A GBoxed type defined as:
struct Boxed {
int foo;
gboolean bar;
int baz;
};
Can be represented either by a JSON object:
{
"foo" : 1,
"bar" : true,
"baz" : 3
}
Or by a JSON array:
[ 1, true, 3 ]
The current function for registering a serialization and a
deserialization pair does not allow registering more than one
deserialization function - which means that there can only be
one way to deserialize a GBoxed type into a specific JsonNode
type.
To allow having more than one JsonNodeType associated to a
GBoxed type and a deserialization function we need to split out
the registration of the serialization and deserialization functions
into two distinct functions.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a GObject class implements JsonSerializable and has overridden
the serialize_property() vfunc then the Serializable should be fully in
charge of serializing a property - that is: JSON-GLib should not try to
add a fallback in case the serialize_property() implementation returned
NULL.
This is a change in semantics for JsonSerializable implementations.
http://bugzilla.openedhand.com/show_bug.cgi?id=1859
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| |
|
|
|
|
|
|
|
|
| |
If you want to use the default implementation of serialize_property()
and/or deserialize_property() from an object class implementing
JsonSerializable you currently have to peek the interface vtable and
then call the vfunc pointers.
We can expose the default implementation through functions ourselves and
simplify the required code.
|
| |
|
|
|
| |
This makes it easier to detect when building without
JSON_DISABLE_DEPRECATED.
|
| |
|
|
| |
Make sure that JSON-GLib is built without using deprecated API.
|
| |
|
|
| |
Tests should not be using API marked as deprecated.
|
| |
|
|
|
| |
Verify that an object with a custom serialize_property() is effectively
what we expect it to be when it is parsed.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Under some locales (e.g. de_DE) a double is converted to a string
containing a comma instead of a dot. That breaks the JSON syntax.
Example:
Double: 0.34 is converted to 0,34 when using locale de_DE
http://bugzilla.openedhand.com/show_bug.cgi?id=1826
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| |
|
|
|
|
|
| |
• Fix the transfer rules for JsonNode, JsonObject and JsonArray
getters.
• Annotate the methods returning lists
|
| | |
|
| |
|
|
|
|
| |
The GEnumValue array defining the enumeration type values must be
static, otherwise everything will crash when trying to retrieve the
enumeration data from the GEnumClass.
|
| |
|
|
|
|
|
|
|
| |
Since we return the member names in insertion order, we should also
return the member values in the same order.
This also allows us to get rid of the (yucky) internal copies of
g_hash_table_get_keys() and g_hash_table_get_values(), since we use
the hash table only for storage and lookup purposes.
|
| |
|
|
|
|
| |
http://bugzilla.openedhand.com/show_bug.cgi?id=1856
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
| |
|
|
|
| |
A missing get_next_token() prevents getting the contents of
the tokenizer in order to place them into the JsonNode.
|
| |
|
|
|
|
|
|
|
| |
The rule for creating the JSON-GLib GIR file should use the
json-glib.la shared object, to avoid using the installed
copy of JSON-GLib when compiling the typelib.
The include file for JSON-GLib is json-glib/json-gobject.h as
well: json-glib/json-object.h does not exist.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Be more GLib-like, and use
<namespace>_<type>_from_data()
<namespace>_<type>_to_data()
Instead of the homebrew "construct" and "serialize", when dealing
with string buffers.
This means:
• adding json_gobject_from_data() to deprecate
json_construct_gobject()
• adding json_gobject_to_data() to deprecate
json_serialize_gobject()
The json_construct_gobject() function also contains a mistake: it
uses gsize with the special value of -1 meaning "slurp the whole
string", but gsize is an unsigned type. The newly added
json_gobject_from_data() correctly uses gssize instead.
|
| |
|
|
|
|
|
|
|
| |
Rename json_gobject_new() to json_gobject_deserialize(), and
json_gobject_dump() to json_gobject_serialize(); this maps the
JSON GBoxed API.
Also for consistency, change the serialize() return value and
the deserialize() argument to be JsonNodes of type JSON_NODE_OBJECT.
|
| |
|
|
|
| |
The json-boxed and json-serializable sections are missing the
long description for the API reference.
|