When running some property based tests, I came across some interesting counterexamples related to NULLABLE(DESC):
DESC?
{
"type": "NULLABLE",
"of": {
"type": "DESC"
}
}
If an implementation happens to have the value represented like:
The resulting encoding could be either 0D 00 01 (inline-everything) or 0F 01 (inline-everything, self-describing).
When decoding the first example, the resulting value would still be:
However, when decoding the second example, the resulting value would be:
Similar issues occur with nested NULLABLE(NULLABLE(... DESC)).
Possible Solutions
- Since
DESC can represent NULL internally, should NULLABLE(DESC) be illegal?
- Similarly, should
NULLABLE(NULLABLE(...)) (nested NULLABLE) also be illegal according to the spec?
I realize this is an edge case 😄 Never would have found it without the fuzz-testing aspects of the property based tests.
When running some property based tests, I came across some interesting counterexamples related to
NULLABLE(DESC):DESC?{ "type": "NULLABLE", "of": { "type": "DESC" } }If an implementation happens to have the value represented like:
The resulting encoding could be either
0D 00 01(inline-everything) or0F 01(inline-everything, self-describing).When decoding the first example, the resulting value would still be:
However, when decoding the second example, the resulting value would be:
Similar issues occur with nested
NULLABLE(NULLABLE(... DESC)).Possible Solutions
DESCcan representNULLinternally, shouldNULLABLE(DESC)be illegal?NULLABLE(NULLABLE(...))(nestedNULLABLE) also be illegal according to the spec?I realize this is an edge case 😄 Never would have found it without the fuzz-testing aspects of the property based tests.