1/

A file-extension for ActivityPub /ActivityStream files.

...

On many web-servers, the Content-Type returned when serving a file is based on the file-extension of the file.

Ex: .txt for text files, .gz for gzip files, .gmni for gemtext files, etc.

I am not aware of a widely used file-extension for ActivityStreams / ActivityPub files.

...

#ActivityPub #ActivityStreams #DeSo #FediDev #FediDevs #Fediverse #FileExtension #OpenSocial #SocialWeb

2/

.json isn't sufficient, since it would produce a Content-Type of "application/json" rather than "application/activity+json".

ActivityPub / ActivityStream files need their own file-extension.

...

#ActivityPub #ActivityStreams #DeSo #FediDev #FediDevs #Fediverse #FileExtension #OpenSocial #SocialWeb

3/

A good file-extension for ActivityPub / ActivityStream files might be:

.activity

And maybe also:

.jsonactivity

Those could be used to trigger a web-server to respond with the Content-Type "application/activity+json".

.

#ActivityPub #ActivityStreams #DeSo #FediDev #FediDevs #Fediverse #FileExtension #OpenSocial #SocialWeb

@reiver why not .activity.jsonld ?

I think that mime.types file in *nixes already uses this convention for other mime-types (application/tm+json, application/sarif+json, etc.)

@reiver I think you could put this into a FEP. :P

@mariusor

That would work for systems that understand the extension of a file "filename.activity.jsonld" to ".activity.jsonld" rather than ".jsonld".

I know some systems would only understand the file-extension to be only ".jsonld".

(Which works well with files such as "movie.mp4.gz" and others like it.)

What about, something without more than one dot (".")?

What about .activity-jsonld or .jsonld-activity, etc?

@reiver I don't know what you mean by "systems" ... a .jsonld extension is supported already by *nix machines through its /etc/mime.type file and the tooling built around that. That translates it to a application/ld+json mime-type. It hasn't made it to IANA yet as far as I see, but we can only hope.

It's not clear to me why it would be important to you to know that a JSONLD file is of the specific ActivityPub flavour.

@reiver what I mean with that is that tools for which the ActivityPub part is important, will probably have different validation heuristics implemented than just checking the extension for the corresponding mime-type.
@reiver For one of my unreleased projects that relies on statically hosted AP objects, I coined the .apjson extension and configured my web server to output the correct MIME type for it. I have no loyalty to it though, any vaguely sensible extension will be just as good in my eyes as any other, and yeah there isn't anything established.