warriordog / ActivityPubSharp

Modular implementation of ActivityPub in C#
https://warriordog.github.io/ActivityPubSharp/
Mozilla Public License 2.0
45 stars 9 forks source link

Collection objects erroneously serialize as arrays #148

Closed warriordog closed 9 months ago

warriordog commented 9 months ago

These types are all converting into JSON arrays instead of objects, because they implement IEnumerable<T>:

This is due to an unresolved limitation in System.Text.Json. For now, we can just remove the interface and add a call to .Items at all call sites. Some uses may require new null handling, since it's possible for a non-null object to have a null Items collection.