You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.
For some use cases it would be very useful to be able to serialize structs as CBOR arrays. The CDDL (https://datatracker.ietf.org/doc/draft-ietf-cbor-cddl/?include_text=1) actually specifies that this should be possible with CBOR and implementations in other languages support this too. On my current project I am trying to implement a representation of certificates with CBOR (https://tools.ietf.org/id/draft-raza-ace-cbor-certificates-00.html) and this requires the struct to be represented as array (which is also even more concise as the current packed format).
Would it make sense to support this in this library or is the more idiomatic way to implement a custom Serializer/Deserializer? In my humble opinion it would be great to have an attribute on structs to control this.
The text was updated successfully, but these errors were encountered:
for now it is easiest to implement it as a custom Serializer/Deserializer. But the more idiomatic way would be to create a new container attribute in serde that specifies that this struct should be serialized as an array.
The deserializer part of this is already implemented by accident. The correct way to implement it would be to adapt Serde Derive to have a container attribute for this purpose.
For some use cases it would be very useful to be able to serialize structs as CBOR arrays. The CDDL (https://datatracker.ietf.org/doc/draft-ietf-cbor-cddl/?include_text=1) actually specifies that this should be possible with CBOR and implementations in other languages support this too. On my current project I am trying to implement a representation of certificates with CBOR (https://tools.ietf.org/id/draft-raza-ace-cbor-certificates-00.html) and this requires the struct to be represented as array (which is also even more concise as the current packed format).
Would it make sense to support this in this library or is the more idiomatic way to implement a custom Serializer/Deserializer? In my humble opinion it would be great to have an attribute on structs to control this.
The text was updated successfully, but these errors were encountered: