Skip to content

Add support for decoding unassigned "simple values" (type 7) #228

Closed
@davidlepilote

Description

@davidlepilote

As per the RFC-7049, it is possible to use the Major Type 7 (0b111) to pass values with no content :
https://tools.ietf.org/html/rfc7049#section-2.3

However, passing one of these value in a CBOR mapper ends with an exception. Here is a Kotlin sample to reproduce the exception :

fun main(args: Array<String>) {
    val cborMapper = ObjectMapper(CBORFactory())
    cborMapper.readValue(byteArrayOf(0b1110, 0b0001), object : TypeReference<Any>() {})
}

This throws the following exception :
Exception in thread "main" com.fasterxml.jackson.core.JsonParseException: Invalid CBOR value token (first byte): 0xe1

It should be possible to use these kinds of values, is there a possibility to solve this problem ?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions