kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

It's impossible to parse non-string keys (e.g. see CBOR Web Tokens)

Open wkornewald opened this issue 4 years ago • 1 comments

Describe the bug

According to the RFC, CBOR Web Tokens use a map with integer keys:

https://datatracker.ietf.org/doc/html/rfc8392

Currently, there is no way to parse such data. Ideally, @SerialName would support arbitrary keys (integer, string, etc.), but even parsing into a Map didn't seem to work because the implementation assumes that keys can only be strings.

Environment

  • Kotlin version: 1.5.10
  • Library version: 1.2.1

wkornewald avatar Jun 18 '21 07:06 wkornewald

see #2412

JesusMcCloud avatar Aug 16 '24 07:08 JesusMcCloud

I suppose it is supported by now via @CborLabel

sandwwraith avatar Oct 04 '24 14:10 sandwwraith