631 views
I'm using Django REST Framework to enable returning items in a wide variety of types, including the internal format (microformats2 canonical JSON) and both versions of ActivityStreams. Here's the response I get from https://00dani.dev/notes.json - the aforementioned canonical JSON, which is exactly what's consumed to produce all the other formats: ```json { "type": ["h-feed"], "properties": { "name": ["/notes ~ 00dani.dev"], "url": ["https://00dani.dev/notes"] }, "children": [{ "type": ["h-entry"], "properties": { "content": ["hello world!"], "category": ["lemoncurry"], "author": [{ "type": ["h-card"], "properties": { "name": ["Danielle McLean"], "photo": ["https://static.00dani.dev/media/avatars/1/deerdrop_crop.png"], "url": ["https://00dani.dev/"] } }], "channel": ["/notes"], "client": ["https://quill.p3k.io/"], "published": ["2018-07-15T03:50:22.378640+00:00"], "updated": ["2018-07-15T03:50:22.378640+00:00"], "uid": ["https://00dani.dev/notes/1"], "url": [ "https://00dani.dev/notes/1", "https://00dani.dev/s/iB" ] } }] } ``` Some of these properties (`channel` and `client` in particular) are nonstandard, but the others are all quite reasonable. However, when I try to retrieve https://00dani.dev/notes.as1, which passes the above structure through `granary.microformats2.json_to_object`, my response only contains the following: ```json { "objectType": "note", "displayName": "/notes ~ 00dani.dev", "url": "https://00dani.dev/notes" } ``` There's no sign of the `h-entry` whatsoever! A similar problem occurs with https://00dani.dev/notes.as2, which isn't surprising since I pass the result of `json_to_object` to `granary.as2.from_as1` to produce that format: ```json { "@context": "https://www.w3.org/ns/activitystreams", "name": "/notes ~ 00dani.dev", "type": "Note", "url": "https://00dani.dev/notes" } ``` Am I calling the wrong method in `granary.microformats2`? I can't see any others that accept canonical microformats2 JSON as input, but this one doesn't seem to be intended for full-blown `h-feed`s.