summaryrefslogtreecommitdiff
path: root/json-glib
Commit message (Collapse)AuthorAgeFilesLines
* generator: ensure valid output double exponential notationMark Nauwelaerts2023-01-262-1/+34
| | | | Fixes #67
* Merge branch 'serializable-docs' into 'master'Emmanuele Bassi2022-10-181-0/+3
|\ | | | | | | | | Document behaviour for deserializing `construct-only` properties See merge request GNOME/json-glib!48
| * serializable: Improve wording of `construct-only` properties commentEmmanuele Bassi2022-10-121-1/+2
| |
| * serializable: Document behaviour for `construct-only` propertiesMatt Jakeman2022-02-061-0/+2
| |
* | Replace g_print with g_test_messageEmmanuele Bassi2022-10-1310-443/+212
| | | | | | | | | | | | | | The test suite for JSON-GLib was written back when we only had gtester-report and freeform verbose test output. These days, we expect everything to conform to the Test Anything Protocol (TAP), which has specific constraints on the output format.
* | Merge branch 'fix-deserialize-data-memory-leak' into 'master'Emmanuele Bassi2022-10-111-1/+4
|\ \ | | | | | | | | | | | | fix deserialize data memory leak See merge request GNOME/json-glib!51
| * | fix deserialize data memory leakGeoffrey Van Landeghem2022-10-111-1/+4
| | |
* | | Merge branch 'coverity-leak' into 'master'Emmanuele Bassi2022-10-112-9/+9
|\ \ \ | | | | | | | | | | | | | | | | builder: Don't leak memory if json_builder_get_root fails sanity check See merge request GNOME/json-glib!46
| * | | builder,parser: Use g_assert for sanity checksRay Strode2021-10-192-9/+9
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity noticed a leak in json_builder_get_root that can't happen in practice. Namely, if internal state gets screwed up and runtime checks are enabled, json_builder_get_root may return NULL without freeing a copy of the builder root it just made. This is because of a g_return_val_if_fail call to bail early if an internal consistency sanity check fails. This commit addresses the coverity complaint by using g_assert instead of g_return_val_if_fail for this sanity check, and other similar sanity checks, in the code.
* | | Add new api json_reader_get_current_nodeFrederic Martinsons2022-10-113-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be useful to extract a sub json structure during parsing of another (for example when we don't know in advance the format of this sub json and just want to pass it to another consumer). Closes #9 Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
* | | Initialise all missing struct fieldsEmmanuele Bassi2022-10-112-38/+52
| | | | | | | | | | | | Avoid compiler warnings.
* | | Drop or mark unused parametersEmmanuele Bassi2022-10-119-24/+29
| | | | | | | | | | | | Avoid compiler warnings when running with `-Wunused-parameter`.
* | | Fix sign comparison warningsEmmanuele Bassi2022-10-1110-58/+34
| | | | | | | | | | | | | | | When running with `-Wsign-compare` we're raising a lot of signed/unsigned comparison warnings.
* | | Add 1.8 version macrosEmmanuele Bassi2022-10-111-0/+32
| | |
* | | Drop usage of raw g_assert in reader test in favor of g_assert_*()Frederic Martinsons2022-10-1114-163/+164
| |/ |/| | | | | | | | | | | | | This will give more informative message in case of fail assertions. Moreover GLib (when compiling with G_DISABLE_ASSERT) disable g_assert totally, that would make these tests no-op Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
* | json-glib/json-builder.c:Farzin2022-02-151-1/+1
|/ | | | | | Delete an extra word Line: 55 Word: root
* Merge branch 'safe-node-init' into 'master'Emmanuele Bassi2021-10-092-6/+20
|\ | | | | | | | | set node->data pointer to null when unset See merge request GNOME/json-glib!37
| * applied suggest changetallua2021-10-101-2/+0
| |
| * Apply 2 suggestion(s) to 1 file(s)Emmanuele Bassi2021-10-091-6/+2
| |
| * Apply 1 suggestion(s) to 1 file(s)Emmanuele Bassi2021-10-091-1/+1
| |
| * remove/add whitespace for coding conventiontallua2021-10-101-2/+1
| |
| * uncomment codetallua2021-04-061-1/+1
| |
| * set node->data pointer to null when unsettallua2021-04-062-0/+21
| |
* | doc: Add missing symbolEmmanuele Bassi2021-06-111-0/+9
| |
* | Update the JSON/GObject API documentationEmmanuele Bassi2021-06-101-11/+13
| |
* | Update the node documentationEmmanuele Bassi2021-06-103-182/+199
| |
* | Update the JSON/GVariant API documentationEmmanuele Bassi2021-06-101-3/+3
| |
* | Update the JsonObject documentationEmmanuele Bassi2021-06-101-83/+86
| |
* | Update the JsonArray documentationEmmanuele Bassi2021-06-101-23/+23
| |
* | Update the documentation of the utility APIEmmanuele Bassi2021-06-101-7/+6
| |
* | Update the JsonParser documentationEmmanuele Bassi2021-06-102-78/+111
| |
* | Update the documentation for the GObject integration APIEmmanuele Bassi2021-06-101-41/+41
| |
* | Update the documentation of the versioning macrosEmmanuele Bassi2021-06-102-13/+34
| |
* | Update the JsonSerializable documentationEmmanuele Bassi2021-06-101-62/+69
| |
* | Update the JsonPath documentationEmmanuele Bassi2021-06-102-46/+45
| |
* | Update the JsonReader documentationEmmanuele Bassi2021-06-102-101/+156
| |
* | Update the JsonGenerator documentationEmmanuele Bassi2021-06-101-34/+35
| |
* | Update the documentation for the GBoxed APIEmmanuele Bassi2021-06-082-30/+74
| |
* | Update JsonBuilder documentationEmmanuele Bassi2021-06-081-78/+114
| | | | | | | | Use gi-docgen links, and drop gtk-doc'isms.
* | Merge branch 'gidocgen' into 'master'Emmanuele Bassi2021-06-0822-861/+734
|\ \ | | | | | | | | | | | | Use gi-docgen to build the API reference See merge request GNOME/json-glib!41
| * | Remove `volatile` from enum registration templateEmmanuele Bassi2021-06-081-1/+1
| | | | | | | | | | | | The `volatile` was dropped from the GLib API, as it's useless.
| * | build: Be strict when generating introspectionEmmanuele Bassi2021-06-081-1/+2
| | | | | | | | | | | | We want all warnings, and we want warnings to be fatal.
| * | docs: Initial, rough port away from gtk-docEmmanuele Bassi2021-06-0820-859/+731
| |/ | | | | | | | | | | | | | | | | | | Drop `SECTION` blurbs. Use gi-docgen syntax for internal links. Use summary lines for gi-docgen indices. Use Markdown syntax for code fragments.
* | trivial: Return the correct type in g_return_val_if_fail()wip/hughsie/typecheckRichard Hughes2021-05-162-5/+5
|/
* Do not leak memory for duplicate var assignmentRichard Hughes2021-02-201-0/+2
| | | | Fixes https://gitlab.gnome.org/GNOME/json-glib/-/issues/58
* parser: Ignore UTF-8 BOM if necessaryhandle-utf8-bomJan-Michael Brummer2020-12-314-1/+46
| | | | | | | | | According to JSON spec BOM shouldn't be part of the JSON data, but also recommends to tolerate files with a BOM marker. As this is common in several Windows JSON generators, handle it graceful in json-glib and skip it for UTF-8 BOM. Fixes: https://gitlab.gnome.org/GNOME/json-glib/-/issues/56
* tests: Add surrogate pair testsJames Westman2020-11-301-0/+3
|
* scanner: Fix crash on malformed surrogate pairsJames Westman2020-11-301-4/+24
| | | | | | | | | | | JSON-GLib would crash when trying to decode escaped Unicode characters, if a character of a surrogate pair was detected but it was in the wrong range, or if the following character was not in the correct range. Fixed by emitting an error ("Parse error: scanner: malformed surrogate pair") before the assertion is run. Fixes #26.
* Fix build reproducibilityAlexander Kanavin2020-11-011-2/+2
| | | | | | | | | Changes the comment and include to reference the file basename instead of the full path. This ensures that the generated file is reproducible when it is included in source packages meant for debugging. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
* Gracefully handle empty arrays and objectsEmmanuele Bassi2020-08-242-11/+14
| | | | | | Don't pretty print newlines. This requires a change in the generator test, but the pretty printing format is not stable anyway, so we can get away with it.