preferCborLabelsOverNames
Parameters
preferCborLabelsOverNames
Specifies whether to serialize element labels (i.e. Long from CborLabel) instead of the element names (i.e. String from SerialName). CBOR supports keys of all types which work just as SerialName
s. COSE restricts this again to strings and numbers and calls these restricted map keys labels. String labels can be assigned by using @SerialName
, while number labels can be assigned using the CborLabel annotation. The preferCborLabelsOverNames configuration switch can be used to prefer number labels over SerialNames in case both are present for a property. This duality allows for compact representation of a type when serialized to CBOR, while keeping expressive diagnostic names when serializing to JSON.