| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
This is the existing behaviour, with a g_critical() removed, and is
consistent with the case when the value is `null` (though not with the
case where it is a wrongly-typed non-`null` scalar).
|
|
|
|
|
|
|
| |
In the case where the key exists, is non-null, and is scalar,
json_object_get_*_member_with_default() defers to json_node_get_*().
These functions implement a variety of type coercions. Test these, and
refer to them in the documentation.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
(cherry picked from commit 8b52960e83328b68e01639f0f112cc3a2d1529e2)
|
|
|
|
| |
(cherry picked from commit 3d7952f80d70b138ce5fadab34449b573742d34a)
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
docs: Clarify some expections of the json_object_get_*_member APIs
Closes #24
See merge request GNOME/json-glib!9
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is an error to use the following with a missing member:
• json_object_get_int_member
• json_object_get_double_member
• json_object_get_boolean_member
• json_object_get_null_member
• json_object_get_string_member
• json_object_get_array_member
• json_object_get_object_member
Doing so will lead to CRITICALs like these:
Json-CRITICAL **: json_object_get_string_member: assertion
'node != NULL' failed
Instead one of these should be used to determine the existence of the
member:
• json_object_get_member
• json_object_has_member
Or, when available, one can use the corresponding
json_object_get_<type>_member_with_default.
https://gitlab.gnome.org/GNOME/json-glib/issues/24
|
| |
|
|
|
|
|
| |
Otherwise gobject-introspection will fail to build because Python's
distutils are terrible.
|
|
|
|
|
|
|
|
|
| |
Whenever we push a tag, we want to create a distributable archive for
json-glib; this will automate the release process.
Ideally, in the future, we'll have the ability to upload the release
archive straight to download.gnome.org, but for now store the archive
and the generated API reference as CI artefacts.
|
|
|
|
|
|
|
|
|
| |
Improve the CI environment for json-glib:
- build the documentation
- use `meson test` instead of `ninja test`
- store the logs on failure
- do not install the result
|
|
|
|
| |
The `mesontest` binary is deprecated, and replaced by `meson test`.
|
|
|
|
|
|
|
|
|
|
| |
We should use more idiomatic Meson:
- improve the coding style
- ensure that the `json_glib_dep` dependency object also includes
the introspection data, if enabled
- add a separate option for the man page generation
- ensure that json-glib can be used as a subproject
|
|
|
|
| |
Meson generates a `dist` target, now.
|
|
|
|
| |
All the build environments know how to build with Meson, now.
|
|
|
|
|
|
| |
We should allow redirecting the output of the format utility to a file,
instead of dumping everything on the standard output. This makes it
easier to use json-glib-format inside a build system or a CI pipeline.
|
| |
|
|
|
|
| |
Meson doesn’t use it, and Damned Lies learned to read po/meson.build.
|
| |
|
|
|
|
| |
… And show a fancy badge.
|
|\
| |
| |
| |
| |
| |
| | |
Add JsonObject getters with fallback value
Closes #4
See merge request GNOME/json-glib!4
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When using the typed getters for JsonObject, the existing API will
automatically fail if the member requested is not present. This is
generally good practice, because JSON data typically does not have a
schema, and thus is has to be validated "on the go"; a JSON object
member that contains `null`, or `0`, or `false`, is indistinguishable
from a JSON object member that does not exist, so we cannot simply
return a scalar value and be done with it.
We can provide an escape hatch, though, for the crowd writing parsers
for JSON data; by using Python as the model, we can add methods that
take a default value as a parameter, and return it as a fallback value
if the requested object member does not exist, or if it's set to `null`.
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
Leak fix
See merge request GNOME/json-glib!6
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We can’t do this by porting to g_autoptr(), because json-glib needs to
be buildable using MSVC. Sad panda.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://gitlab.gnome.org/GNOME/json-glib/issues/30
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Small leak. With some additional fixes to the tests themselves, this
makes all the tests run valgrind-clean. (See the following commit.)
Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://gitlab.gnome.org/GNOME/json-glib/issues/30
|
|\ \ \
| |/ /
|/| |
| | |
| | | |
json-parser: Fix getting immutable root nodes from empty input
See merge request GNOME/json-glib!8
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If parsing an empty document, it’s allowed to return NULL from
json_parser_get_root(). This was broken for immutable parsers when
immutability support was added (an assertion fails). Fix that, and also
document that json_parser_get_root() may return NULL.
Do the same for json_parser_steal_root() too, which is another way that
the root node may be NULL.
Add a unit test.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|\ \ \
| |/ /
|/| |
| | |
| | | |
json-node: Clarify documentation regarding programmer errors
See merge request GNOME/json-glib!7
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Despite my efforts in commit 011c1e424b7 (parts of which were completely
incorrect), the JsonNode documentation still wasn’t particularly helpful
about differentiating between methods which return NULL if the JsonNode
is not of the right type, and methods which emit a critical warning.
Try and improve that across the board, hopefully without saying
blatantly incorrect things this time.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|\ \
| | |
| | |
| | |
| | | |
node: Use json_node_unref for the JsonNode autoptr cleanup
See merge request GNOME/json-glib!5
|
|/ /
| |
| |
| |
| |
| | |
json_node_unref was added after the autoptr macros were written.
This fixes an assertion failure if using autoptr and json_node_ref.
|
|\ \
| |/
|/|
| |
| |
| |
| | |
Update json-enum-types.h.in to improve reproducibility of the build.
See merge request GNOME/json-glib!3
Fixes issue #29
|
|/ |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Use fuzzy comparisons for floating point values
Closes #27 and #28
See merge request GNOME/json-glib!2
|
| |
| |
| |
| |
| |
| | |
Direct comparison should never be used for floating point values.
Fixes #27 and #28.
|
|/
|
|
|
| |
We do compare floating point values elsewhere in our code, so we should
ensure that we're doing that with a certain amount of fuzziness.
|
| |
|