I hope more #ActivityPub implementations start properly handling JSON-LD documents in various forms, rather than using ad-hoc approaches like only allowing specific fields to accept both arrays and scalar values.
-
@hongminhee Thank you
(my server can handle an object, but you do a favor to all who are only beginning to develop their fedi projects)
-
Why don't you fix your software instead?
It sounds like you're referring to this issue:
https://github.com/pixelfed/pixelfed/issues/6588
But in Fediverse,
attachmentis not supposed to be an object, it's an array.I don't think you should expect people to comply with your vision of ActivityPub.
> attachment is not supposed to be an object, it's an array.
@silverpill I don't understand how you infer that from this spec: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attachment
-
@hongminhee so, I've been dealing with this problem a lot with tags.pub.
I have found that many projects are open to issues and patches. Even if I have to downgrade what I'm sending over the wire to the least common denominator, I have some hope that the next people who build to the spec will get better interoperability.
I think having good libraries can make the JSON-LD easier.
-
Why don't you fix your software instead?
It sounds like you're referring to this issue:
https://github.com/pixelfed/pixelfed/issues/6588
But in Fediverse,
attachmentis not supposed to be an object, it's an array.I don't think you should expect people to comply with your vision of ActivityPub.
@silverpill @hongminhee single element arrays in JSON-LD go to the element itself, not an array.
-
@hongminhee so, I've been dealing with this problem a lot with tags.pub.
I have found that many projects are open to issues and patches. Even if I have to downgrade what I'm sending over the wire to the least common denominator, I have some hope that the next people who build to the spec will get better interoperability.
I think having good libraries can make the JSON-LD easier.
@evan@cosocial.ca Can't agree more.
I think having good libraries can make the JSON-LD easier.
Yeah, that's one of reasons why I started Fedify; it was started from building a type-safe Activity Vocabulary library for TypeScript which lets me free from dealing with all complicated things about JSON-LD and keeping it standard-compliant at a time!
-
> attachment is not supposed to be an object, it's an array.
@silverpill I don't understand how you infer that from this spec: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attachment
@mariusor @silverpill @hongminhee yeah, that's definitely not what the spec says.
"The serialized JSON form of an Activity Streams 2.0 document MUST be consistent with what would be produced by the standard JSON-LD 1.0 Processing Algorithms and API [JSON-LD-API] Compaction Algorithm"
-
@hongminhee So, I really appreciate that you are doing this work. I know it's hard, and it feels unrewarding, but it really matters, and it really helps the ecosystem.
Please let me know if I can help out in these efforts.
I hope that all of us in the ActivityPub community take these requests seriously when they come in.
-
> attachment is not supposed to be an object, it's an array.
@silverpill I don't understand how you infer that from this spec: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attachment
-
@hongminhee the activitystrea.ms library does a pretty good job of parsing and generating AS2, in a uniform way. It pushes you into better habits, which I appreciate.
My book does bare-JSON parsing in all the major examples; I should probably change it in the next version.
Should we start a page for JSON-LD-based AS2 libraries? I think @cwebber did a good Python one, and there may be others.
-
@mariusor @hongminhee I didn't infer that from the spec, it's how Fediverse works.
-
@hongminhee the activitystrea.ms library does a pretty good job of parsing and generating AS2, in a uniform way. It pushes you into better habits, which I appreciate.
My book does bare-JSON parsing in all the major examples; I should probably change it in the next version.
Should we start a page for JSON-LD-based AS2 libraries? I think @cwebber did a good Python one, and there may be others.
@evan @hongminhee @cwebber could you share a link to that Python one?
-
@evan @hongminhee @cwebber could you share a link to that Python one?
-
@mariusor @hongminhee I bet the software you're using right now always sends an array
@silverpill I do not bow to the Mastodon imperialism.
-
@silverpill I do not bow to the Mastodon imperialism.
-
@hongminhee the activitystrea.ms library does a pretty good job of parsing and generating AS2, in a uniform way. It pushes you into better habits, which I appreciate.
My book does bare-JSON parsing in all the major examples; I should probably change it in the next version.
Should we start a page for JSON-LD-based AS2 libraries? I think @cwebber did a good Python one, and there may be others.
@evan @hongminhee yes I think we should!
-
@hongminhee It's subtly more messed up than that. AP didn't explicitly allow all 3, but it calls out in a non-normative note that implementers may produce non-canonical serializations.
Right now, as:Public is canonical. Public would be canonical if properties like to/cc/audience were vocab-relative, but they aren't (and shouldn't be). Undefining the as: prefix results in the full URI being canonical.
I think introducing a vocab relative term for visibility could make sense, using Public.
-
@hongminhee @jamie why do we need this kind of complication? What's wrong with just always expecting an array and simplifying the standard instead?
-
Why don't you fix your software instead?
It sounds like you're referring to this issue:
https://github.com/pixelfed/pixelfed/issues/6588
But in Fediverse,
attachmentis not supposed to be an object, it's an array.I don't think you should expect people to comply with your vision of ActivityPub.
@silverpill @hongminhee why do we need this kind of complication? What's wrong with just always expecting an array and simplifying the standard instead?
-
@mariusor @silverpill @hongminhee yeah, that's definitely not what the spec says.
"The serialized JSON form of an Activity Streams 2.0 document MUST be consistent with what would be produced by the standard JSON-LD 1.0 Processing Algorithms and API [JSON-LD-API] Compaction Algorithm"
@evan @mariusor @silverpill @hongminhee I can't wait for us to finally drop jsonld in a living standard
