Encoding cbor.SimpleValue with values 24..31 should fail because CBOR simple values 24..31 are reserved and they MUST NOT be encoded according to RFC 8949.
This PR makes encoder return UnsupportedValueError when encoding cbor.SimpleValue with values 24..31 because that would not be a well-formed CBOR data item.
Decoding other CBOR types to cbor.SimpleValue should fail because cbor.SimpleValue represents CBOR simple value (major type 7) which is different from CBOR integers and shouldn't be used interchangeably.
This PR makes decoder return UnmarshalTypeError when decoding other CBOR types to cbor.SimpleValue.
Closes #462 #463
Encoding
cbor.SimpleValue
with values 24..31 should fail because CBOR simple values 24..31 are reserved and they MUST NOT be encoded according to RFC 8949.This PR makes encoder return
UnsupportedValueError
when encodingcbor.SimpleValue
with values 24..31 because that would not be a well-formed CBOR data item.Decoding other CBOR types to
cbor.SimpleValue
should fail becausecbor.SimpleValue
represents CBOR simple value (major type 7) which is different from CBOR integers and shouldn't be used interchangeably.This PR makes decoder return
UnmarshalTypeError
when decoding other CBOR types tocbor.SimpleValue
.