warriordog / ActivityPubSharp

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

Parameterless constructor for TypeMapConverter #159

Closed jenniferplusplus closed 8 months ago

jenniferplusplus commented 8 months ago

This allows the JsonLdSerializer to be used as an AspNet formatter.

jenniferplusplus commented 8 months ago

@warriordog have you had a chance to review this? I'll need something like this in order to make APSharp.Types types usable as args or return values in ASP.NET core controllers.

Edit: hang on, maybe not. I'm trying something

warriordog commented 8 months ago

@jenniferplusplus Actually, I'm going to go ahead and merge this. Then I can go ahead and start work in #153, which will get rid of this class entirely.

jenniferplusplus commented 8 months ago

@warriordog cool, thanks. Don't worry, these issues aren't significant blockers for me. I have no trouble making local changes to ActivityPubSharp for experiments. In the (hopefully, very) near future I'll need published packages to depend on, for a merge back to main. But that hasn't been a problem so far.

And for what it's worth, the thing I tried worked. I was trying a more proper use of Formatters, which do have access to DI, and that worked. It's not even as annoying to configure as I had been telling myself it would be.

Ex: https://github.com/Letterbook/Letterbook/blob/6596d3ee34552b84c6fd4d0f8e61c21f65cb92ef/Letterbook.Adapter.ActivityPub/JsonLdInputFormatter.cs#L22-L33

(This route might make it harder to depend on derived types as input to controllers, but, I'm not even sure that's a real problem.)

warriordog commented 8 months ago

@jenniferplusplus does that mean that you don't need the static instance now?

jenniferplusplus commented 8 months ago

@warriordog I believe so, yes. I'm like a month+ into this very messy trial-and-error initial interop work, and it's a little hard to be sure I'm not depending on something I only have locally. But I really (really) hope that's wrapping up the next day or two, and it will be a lot easier to confirm then.

warriordog commented 8 months ago

@jenniferplusplus ok, please let me know when you have an answer! I'd love to remove the static stuff if possible.

jenniferplusplus commented 8 months ago

@warriordog Just letting you know I haven't forgotten about this. I'll get to it soon, but probably not before christmas.