cddl-codegen icon indicating copy to clipboard operation
cddl-codegen copied to clipboard

Non-overlapping group choice with additional encoding does not generate valid deserialization code with `--preserve-encodings=true`

Open rooooooooob opened this issue 1 year ago • 0 comments

with --preserve-encodings=true

non_overlap_basic_not_basic = [
  ; @name group
  basic //
  ; @name group_arr
  basic_arr //
  ; @name group_tagged
  #6.11(basic) //
  ; @name group_bytes
  bytes .cbor basic
]

All encoding details such as len_encoding (for outer array) or the tag/bytes encodings for the last two variants are not handled during deserialization. The code will not compile and they are completely not handled.

This works correctly in the regular (overlapping cbor-types i.e. brute-force try-all-variants) deserialization logic.

rooooooooob avatar Apr 19 '24 02:04 rooooooooob