mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Removed DeserializationError::NotSupported
This commit is contained in:
		| @@ -7,6 +7,7 @@ HEAD | |||||||
| * Removed support for `char` values, see below (issue #1498) | * Removed support for `char` values, see below (issue #1498) | ||||||
| * `deserializeJson()` leaves `\uXXXX` unchanged instead of returning `NotSupported` | * `deserializeJson()` leaves `\uXXXX` unchanged instead of returning `NotSupported` | ||||||
| * `deserializeMsgPack()` inserts `null` instead of returning `NotSupported` | * `deserializeMsgPack()` inserts `null` instead of returning `NotSupported` | ||||||
|  | * Removed `DeserializationError::NotSupported` | ||||||
|  |  | ||||||
| > ### BREAKING CHANGES | > ### BREAKING CHANGES | ||||||
| > | > | ||||||
| @@ -29,6 +30,13 @@ HEAD | |||||||
| > int8_t age; | > int8_t age; | ||||||
| > doc["age"] = age;  // OK | > doc["age"] = age;  // OK | ||||||
| > ``` | > ``` | ||||||
|  | > | ||||||
|  | > On a different topic, `DeserializationError::NotSupported` has been removed. | ||||||
|  | > Instead of returning this error: | ||||||
|  | > | ||||||
|  | > * `deserializeJson()` leaves `\uXXXX` unchanged (only when `ARDUINOJSON_DECODE_UNICODE` is `0`) | ||||||
|  | > * `deserializeMsgPack()` replaces unsupported values with `null`s | ||||||
|  |  | ||||||
|  |  | ||||||
| v6.17.3 (2021-02-15) | v6.17.3 (2021-02-15) | ||||||
| ------- | ------- | ||||||
|   | |||||||
| @@ -34,7 +34,6 @@ TEST_CASE("DeserializationError") { | |||||||
|     TEST_STRINGIFICATION(IncompleteInput); |     TEST_STRINGIFICATION(IncompleteInput); | ||||||
|     TEST_STRINGIFICATION(InvalidInput); |     TEST_STRINGIFICATION(InvalidInput); | ||||||
|     TEST_STRINGIFICATION(NoMemory); |     TEST_STRINGIFICATION(NoMemory); | ||||||
|     TEST_STRINGIFICATION(NotSupported); |  | ||||||
|     TEST_STRINGIFICATION(TooDeep); |     TEST_STRINGIFICATION(TooDeep); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -44,7 +43,6 @@ TEST_CASE("DeserializationError") { | |||||||
|     TEST_BOOLIFICATION(IncompleteInput, true); |     TEST_BOOLIFICATION(IncompleteInput, true); | ||||||
|     TEST_BOOLIFICATION(InvalidInput, true); |     TEST_BOOLIFICATION(InvalidInput, true); | ||||||
|     TEST_BOOLIFICATION(NoMemory, true); |     TEST_BOOLIFICATION(NoMemory, true); | ||||||
|     TEST_BOOLIFICATION(NotSupported, true); |  | ||||||
|     TEST_BOOLIFICATION(TooDeep, true); |     TEST_BOOLIFICATION(TooDeep, true); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -181,6 +181,5 @@ TEST_CASE("DeserializationError::f_str()") { | |||||||
|   TEST_STRINGIFICATION(IncompleteInput); |   TEST_STRINGIFICATION(IncompleteInput); | ||||||
|   TEST_STRINGIFICATION(InvalidInput); |   TEST_STRINGIFICATION(InvalidInput); | ||||||
|   TEST_STRINGIFICATION(NoMemory); |   TEST_STRINGIFICATION(NoMemory); | ||||||
|   TEST_STRINGIFICATION(NotSupported); |  | ||||||
|   TEST_STRINGIFICATION(TooDeep); |   TEST_STRINGIFICATION(TooDeep); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -26,7 +26,6 @@ class DeserializationError { | |||||||
|     IncompleteInput, |     IncompleteInput, | ||||||
|     InvalidInput, |     InvalidInput, | ||||||
|     NoMemory, |     NoMemory, | ||||||
|     NotSupported, |  | ||||||
|     TooDeep |     TooDeep | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
| @@ -81,8 +80,8 @@ class DeserializationError { | |||||||
|  |  | ||||||
|   const char* c_str() const { |   const char* c_str() const { | ||||||
|     static const char* messages[] = { |     static const char* messages[] = { | ||||||
|         "Ok",       "EmptyInput",   "IncompleteInput", "InvalidInput", |         "Ok",           "EmptyInput", "IncompleteInput", | ||||||
|         "NoMemory", "NotSupported", "TooDeep"}; |         "InvalidInput", "NoMemory",   "TooDeep"}; | ||||||
|     ARDUINOJSON_ASSERT(static_cast<size_t>(_code) < |     ARDUINOJSON_ASSERT(static_cast<size_t>(_code) < | ||||||
|                        sizeof(messages) / sizeof(messages[0])); |                        sizeof(messages) / sizeof(messages[0])); | ||||||
|     return messages[_code]; |     return messages[_code]; | ||||||
| @@ -95,11 +94,9 @@ class DeserializationError { | |||||||
|     ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s2, "IncompleteInput"); |     ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s2, "IncompleteInput"); | ||||||
|     ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s3, "InvalidInput"); |     ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s3, "InvalidInput"); | ||||||
|     ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s4, "NoMemory"); |     ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s4, "NoMemory"); | ||||||
|     ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s5, "NotSupported"); |     ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s5, "TooDeep"); | ||||||
|     ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s6, "TooDeep"); |  | ||||||
|     ARDUINOJSON_DEFINE_STATIC_ARRAY( |     ARDUINOJSON_DEFINE_STATIC_ARRAY( | ||||||
|         const char*, messages, |         const char*, messages, ARDUINOJSON_EXPAND6({s0, s1, s2, s3, s4, s5})); | ||||||
|         ARDUINOJSON_EXPAND7({s0, s1, s2, s3, s4, s5, s6})); |  | ||||||
|     return ARDUINOJSON_READ_STATIC_ARRAY(const __FlashStringHelper*, messages, |     return ARDUINOJSON_READ_STATIC_ARRAY(const __FlashStringHelper*, messages, | ||||||
|                                          _code); |                                          _code); | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -5,7 +5,6 @@ | |||||||
| #pragma once | #pragma once | ||||||
|  |  | ||||||
| #define ARDUINOJSON_EXPAND6(a, b, c, d, e, f) a, b, c, d, e, f | #define ARDUINOJSON_EXPAND6(a, b, c, d, e, f) a, b, c, d, e, f | ||||||
| #define ARDUINOJSON_EXPAND7(a, b, c, d, e, f, g) a, b, c, d, e, f, g |  | ||||||
| #define ARDUINOJSON_EXPAND9(a, b, c, d, e, f, g, h, i) a, b, c, d, e, f, g, h, i | #define ARDUINOJSON_EXPAND9(a, b, c, d, e, f, g, h, i) a, b, c, d, e, f, g, h, i | ||||||
| #define ARDUINOJSON_EXPAND18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, \ | #define ARDUINOJSON_EXPAND18(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, \ | ||||||
|                              q, r)                                           \ |                              q, r)                                           \ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user