2015-05-23 15:32:50 +02:00
ArduinoJson: change log
=======================
2024-11-17 15:40:21 +01:00
HEAD
----
* Fix support for NUL characters in `deserializeJson()`
2024-11-25 10:46:21 +01:00
* Make `ElementProxy` and `MemberProxy` non-copyable
2024-11-25 11:32:03 +01:00
* Change string copy policy: only string literal are stored by pointer
2024-11-26 10:10:52 +01:00
* `JsonString` is now stored by copy, unless specified otherwise
2024-11-26 14:32:29 +01:00
* Replace undocumented `JsonString::Ownership` with `bool`
2024-11-26 14:32:21 +01:00
* Rename undocumented `JsonString::isLinked()` to `isStatic()`
2024-11-25 10:46:21 +01:00
> ### BREAKING CHANGES
>
> In previous versions, `MemberProxy` (the class returned by `operator[]`) could lead to dangling pointers when used with a temporary string.
> To prevent this issue, `MemberProxy` and `ElementProxy` are now non-copyable.
>
> Your code is likely to be affected if you use `auto` to store the result of `operator[]`. For example, the following line won't compile anymore:
>
> ```cpp
> auto value = doc["key"];
> ```
>
> To fix the issue, you must append either `.as<T>()` or `.to<T>()`, depending on the situation.
>
> For example, if you are extracting values from a JSON document, you should update like this:
>
> ```diff
> - auto config = doc["config"];
> + auto config = doc["config"].as<JsonObject>();
> const char* name = config["name"];
> ```
>
> However, if you are building a JSON document, you should update like this:
>
> ```diff
> - auto config = doc["config"];
> + auto config = doc["config"].to<JsonObject>();
> config["name"] = "ArduinoJson";
> ```
2024-11-17 15:40:21 +01:00
2024-11-15 09:05:29 +01:00
v7.2.1 (2024-11-15)
------
2024-10-23 15:20:42 +02:00
* Forbid `deserializeJson(JsonArray|JsonObject, ...)` (issue #2135 )
2024-11-07 14:20:33 +01:00
* Fix VLA support in `JsonDocument::set()`
2024-11-14 14:56:47 +01:00
* Fix `operator[](variant)` ignoring NUL characters
2024-10-23 15:20:42 +02:00
2024-09-18 10:48:50 +02:00
v7.2.0 (2024-09-18)
------
2024-08-23 15:31:47 +02:00
* Store object members with two slots: one for the key and one for the value
2024-08-27 08:02:09 +02:00
* Store 64-bit numbers (`double` and `long long` ) in an additional slot
* Reduce the slot size (see table below)
2024-08-27 10:15:43 +02:00
* Improve message when user forgets third arg of `serializeJson()` et al.
2024-08-27 14:53:28 +02:00
* Set `ARDUINOJSON_USE_DOUBLE` to `0` by default on 8-bit architectures
2024-09-06 17:32:09 +02:00
* Deprecate `containsKey()` in favor of `doc["key"].is<T>()`
2024-09-17 10:25:25 +02:00
* Add support for escape sequence `\'` (issue #2124 )
2024-08-27 08:02:09 +02:00
| Architecture | before | after |
|--------------|----------|----------|
| 8-bit | 8 bytes | 6 bytes |
| 32-bit | 16 bytes | 8 bytes |
| 64-bit | 24 bytes | 16 bytes |
2024-08-23 15:31:47 +02:00
2024-09-06 17:32:09 +02:00
> ### BREAKING CHANGES
>
> After being on the death row for years, the `containsKey()` method has finally been deprecated.
> You should replace `doc.containsKey("key")` with `doc["key"].is<T>()`, which not only checks that the key exists but also that the value is of the expected type.
>
> ```cpp
> // Before
> if (doc.containsKey("value")) {
> int value = doc["value"];
> // ...
> }
>
> // After
> if (doc["value"].is<int>()) {
> int value = doc["value"];
> // ...
> }
> ```
2024-06-27 18:20:22 +02:00
v7.1.0 (2024-06-27)
------
2024-05-15 09:33:30 +02:00
2024-04-18 14:19:43 +02:00
* Add `ARDUINOJSON_STRING_LENGTH_SIZE` to the namespace name
2024-06-06 18:33:48 +02:00
* Add support for MsgPack binary (PR #2078 by @Sanae6 )
* Add support for MsgPack extension
2024-05-01 13:59:55 +02:00
* Make string support even more generic (PR #2084 by @d -a-v)
2024-05-01 17:58:51 +02:00
* Optimize `deserializeMsgPack()`
2024-05-14 21:06:02 +02:00
* Allow using a `JsonVariant` as a key or index (issue #2080 )
Note: works only for reading, not for writing
2024-05-15 09:33:30 +02:00
* Support `ElementProxy` and `MemberProxy` in `JsonDocument` 's constructor
2024-05-23 18:36:24 +02:00
* Don't add partial objects when allocation fails (issue #2081 )
2024-06-18 13:50:50 +02:00
* Read MsgPack's 64-bit integers even if `ARDUINOJSON_USE_LONG_LONG` is `0`
(they are set to `null` if they don't fit in a `long` )
2024-04-18 14:19:43 +02:00
2024-03-12 09:40:46 +01:00
v7.0.4 (2024-03-12)
------
2024-02-18 19:58:22 +01:00
* Make `JSON_STRING_SIZE(N)` return `N+1` to fix third-party code (issue #2054 )
2024-02-05 13:34:38 +01:00
v7.0.3 (2024-02-05)
------
2024-01-26 10:34:49 +01:00
* Improve error messages when using `char` or `char*` (issue #2043 )
2024-02-05 11:26:55 +01:00
* Reduce stack consumption (issue #2046 )
2024-02-01 21:37:45 +01:00
* Fix compatibility with GCC 4.8 (issue #2045 )
2024-01-26 10:34:49 +01:00
2024-01-19 14:36:16 +01:00
v7.0.2 (2024-01-19)
------
2024-01-16 10:10:43 +01:00
* Fix assertion `poolIndex < count_` after `JsonDocument::clear()` (issue #2034 )
2024-01-10 21:14:07 +01:00
v7.0.1 (2024-01-10)
------
2024-01-03 16:30:44 +01:00
* Fix "no matching function" with `JsonObjectConst::operator[]` (issue #2019 )
2024-01-04 18:01:52 +01:00
* Remove unused files in the PlatformIO package
2024-01-10 13:30:26 +01:00
* Fix `volatile bool` serialized as `1` or `0` instead of `true` or `false` (issue #2029 )
2024-01-03 16:30:44 +01:00
2024-01-03 09:19:34 +01:00
v7.0.0 (2024-01-03)
------
2023-02-10 09:36:18 +01:00
2023-03-20 14:49:08 +01:00
* Remove `BasicJsonDocument`
2023-03-15 14:54:55 +01:00
* Remove `StaticJsonDocument`
2023-03-20 14:47:27 +01:00
* Add abstract `Allocator` class
2023-03-20 10:49:01 +01:00
* Merge `DynamicJsonDocument` with `JsonDocument`
2023-03-29 19:18:06 +02:00
* Remove `JSON_ARRAY_SIZE()` , `JSON_OBJECT_SIZE()` , and `JSON_STRING_SIZE()`
2023-07-29 06:33:29 +02:00
* Remove `ARDUINOJSON_ENABLE_STRING_DEDUPLICATION` (string deduplication cannot be disabled anymore)
2023-04-02 16:47:37 +02:00
* Remove `JsonDocument::capacity()`
2023-04-11 10:03:47 +02:00
* Store the strings in the heap
2023-04-17 09:46:41 +02:00
* Reference-count shared strings
2023-05-02 09:36:40 +02:00
* Always store `serialized("string")` by copy (#1915 )
2023-05-10 09:55:21 +02:00
* Remove the zero-copy mode of `deserializeJson()` and `deserializeMsgPack()`
2023-07-05 16:18:35 +02:00
* Fix double lookup in `to<JsonVariant>()`
2023-07-12 14:54:19 +02:00
* Fix double call to `size()` in `serializeMsgPack()`
* Include `ARDUINOJSON_SLOT_OFFSET_SIZE` in the namespace name
2023-07-17 18:15:13 +02:00
* Remove `JsonVariant::shallowCopy()`
* `JsonDocument` 's capacity grows as needed, no need to pass it to the constructor anymore
2023-07-20 17:54:38 +02:00
* `JsonDocument` 's allocator is not monotonic anymore, removed values get recycled
2023-07-23 18:08:21 +02:00
* Show a link to the documentation when user passes an unsupported input type
2023-07-24 17:21:25 +02:00
* Remove `JsonDocument::memoryUsage()`
2023-07-25 14:37:25 +02:00
* Remove `JsonDocument::garbageCollect()`
2023-07-29 05:07:20 +02:00
* Add `deserializeJson(JsonVariant, ...)` and `deserializeMsgPack(JsonVariant, ...)` (#1226 )
2023-07-31 17:34:17 +02:00
* Call `shrinkToFit()` in `deserializeJson()` and `deserializeMsgPack()`
2023-07-31 18:37:35 +02:00
* `serializeJson()` and `serializeMsgPack()` replace the content of `std::string` and `String` instead of appending to it
2023-08-09 10:57:52 +02:00
* Replace `add()` with `add<T>()` (`add(T)` is still supported)
2023-08-09 11:31:29 +02:00
* Remove `createNestedArray()` and `createNestedObject()` (use `to<JsonArray>()` and `to<JsonObject>()` instead)
2023-08-09 18:45:53 +02:00
> ### BREAKING CHANGES
>
> As every major release, ArduinoJson 7 introduces several breaking changes.
> I added some stubs so that most existing programs should compile, but I highty recommend you upgrade your code.
>
> #### `JsonDocument`
>
> In ArduinoJson 6, you could allocate the memory pool on the stack (with `StaticJsonDocument`) or in the heap (with `DynamicJsonDocument`).
> In ArduinoJson 7, the memory pool is always allocated in the heap, so `StaticJsonDocument` and `DynamicJsonDocument` have been merged into `JsonDocument`.
>
> In ArduinoJson 6, `JsonDocument` had a fixed capacity; in ArduinoJson 7, it has an elastic capacity that grows as needed.
> Therefore, you don't need to specify the capacity anymore, so the macros `JSON_ARRAY_SIZE()`, `JSON_OBJECT_SIZE()`, and `JSON_STRING_SIZE()` have been removed.
>
> ```c++
> // ArduinoJson 6
> StaticJsonDocument<256> doc;
> // or
> DynamicJsonDocument doc(256);
>
> // ArduinoJson 7
> JsonDocument doc;
> ```
>
> In ArduinoJson 7, `JsonDocument` reuses released memory, so `garbageCollect()` has been removed.
> `shrinkToFit()` is still available and releases the over-allocated memory.
>
> Due to a change in the implementation, it's not possible to store a pointer to a variant from another `JsonDocument`, so `shallowCopy()` has been removed.
>
> In ArduinoJson 6, the meaning of `memoryUsage()` was clear: it returned the number of bytes used in the memory pool.
> In ArduinoJson 7, the meaning of `memoryUsage()` would be ambiguous, so it has been removed.
>
> #### Custom allocators
>
> In ArduinoJson 6, you could specify a custom allocator class as a template parameter of `BasicJsonDocument`.
> In ArduinoJson 7, you must inherit from `ArduinoJson::Allocator` and pass a pointer to an instance of your class to the constructor of `JsonDocument`.
>
> ```c++
> // ArduinoJson 6
> class MyAllocator {
> // ...
> };
> BasicJsonDocument<MyAllocator> doc(256);
>
> // ArduinoJson 7
> class MyAllocator : public ArduinoJson::Allocator {
> // ...
> };
> MyAllocator myAllocator;
> JsonDocument doc(&myAllocator);
> ```
>
> #### `createNestedArray()` and `createNestedObject()`
>
> In ArduinoJson 6, you could create a nested array or object with `createNestedArray()` and `createNestedObject()`.
> In ArduinoJson 7, you must use `add<T>()` or `to<T>()` instead.
>
> For example, to create `[[],{}]`, you would write:
>
> ```c++
> // ArduinoJson 6
2024-01-03 09:19:14 +01:00
> arr.createNestedArray();
> arr.createNestedObject();
2023-08-09 18:45:53 +02:00
>
> // ArduinoJson 7
2024-01-03 09:19:14 +01:00
> arr.add<JsonArray>();
> arr.add<JsonObject>();
2023-08-09 18:45:53 +02:00
> ```
>
> And to create `{"array":[],"object":{}}`, you would write:
>
> ```c++
> // ArduinoJson 6
2024-01-03 09:19:14 +01:00
> obj.createNestedArray("array");
> obj.createNestedObject("object");
2023-08-09 18:45:53 +02:00
>
> // ArduinoJson 7
2024-01-03 09:19:14 +01:00
> obj["array"].to<JsonArray>();
> obj["object"].to<JsonObject>();
2023-08-09 18:45:53 +02:00
> ```