warriordog / ActivityPubSharp

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

Project 1: UnknownJsonProperties is not populated #91

Closed warriordog closed 1 year ago

warriordog commented 1 year ago

Regression due to converter rewrite

warriordog commented 1 year ago

Solution may involve moving this to TypeMap

warriordog commented 1 year ago

System.Text.Json has a built-in overflow JSON feature, but it wont quite work since we convert into multiple subset entities. One sub-optimal workaround is this:

This works because all non-overflow properties will be missing from at least one entity, which means that the union set is equal to the set of unmapped properties. There's a major downside, which is performance. We have to convert every extra property multiple times, and then do an additional pass to compute the final set. That is far from ideal.

warriordog commented 1 year ago

Another option is this:

Downside: special handling is needed to handle the case where a property is changed to null or another ignored value. This may not be possible.

warriordog commented 1 year ago

Done. All tests are now passing!