Skip to content

Commit f9416ac

Browse files
committed
Implement MarshalJSON for CrossSigningKeyOrDevice
1 parent d9c3f40 commit f9416ac

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

crosssigning.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ type CrossSigningForKeyOrDevice struct {
5252
CrossSigningBody
5353
}
5454

55+
// Implements json.Marshaler
56+
func (c CrossSigningForKeyOrDevice) MarshalJSON() ([]byte, error) {
57+
// Marshal the contents at the top level, rather than having it embedded
58+
// in a "CrossSigningBody" JSON key.
59+
return json.Marshal(c.CrossSigningBody)
60+
}
61+
5562
// Implements json.Unmarshaler
5663
func (c *CrossSigningForKeyOrDevice) UnmarshalJSON(b []byte) error {
5764
if gjson.GetBytes(b, "device_id").Exists() {

0 commit comments

Comments
 (0)