@@ -112,7 +112,7 @@ early implementation bug that finally became the de-facto standard.
112
112
113
113
Booleans are encoded differently depending on whether it is a field value (in a struct) or an element value (in a set,
114
114
list or map). Field values are encoded directly in the field header. Element values of type ` bool ` are sent as an
115
- ` int8 ` ; true as ` 1 ` and false as ` 0 ` .
115
+ ` int8 ` ; true as ` 1 ` and false as ` 2 ` .
116
116
117
117
### Universal unique identifier encoding
118
118
@@ -247,9 +247,9 @@ Where:
247
247
248
248
The short form should be used when the length is in the range 0 - 14 (inclusive).
249
249
250
- The following element-types are used (see note below):
250
+ The following element-types are used (see note 1 below):
251
251
252
- * ` BOOL ` , encoded as ` 2 `
252
+ * ` BOOL ` , encoded as ` 1 ` or '2' (see note 2 below)
253
253
* ` I8 ` , encoded as ` 3 `
254
254
* ` I16 ` , encoded as ` 4 `
255
255
* ` I32 ` , encoded as ` 5 `
@@ -262,8 +262,12 @@ The following element-types are used (see note below):
262
262
* ` STRUCT ` , used for structs and union fields, encoded as ` 12 `
263
263
* ` UUID ` , encoded as ` 13 `
264
264
265
- * Note* : Although field-types and element-types lists are currently very similar, there is _ no guarantee_ that this will
265
+ * Note* :
266
+ 1 . Although field-types and element-types lists are currently very similar, there is _ no guarantee_ that this will
266
267
remain true after new types are added.
268
+ 2 . For historical and compatibility reasons, a reader should be capable to deal with * both* cases.
269
+ The only valid value in the original spec was '2', but due to an widespread implementation bug the defacto
270
+ standard across large parts of the library became '1' instead. As a result, both values are now allowed.
267
271
268
272
The maximum list/set size is configurable. By default there is no limit (meaning the limit is the maximum int32 value:
269
273
2147483647).
0 commit comments