Email or username:

Password:

Forgot your password?
Gregory

An internal #Smithereen update: I replaced the org.json JSON library with gson. It allows for somewhat cleaner code with its JsonElement base class for everything, supports serializing/deserializing Java objects directly (will come in especially handy for when I'll be making the API!), and preserves a sane order of keys in objects. Yes, that last part is very important because it hurt to read the mess that came out of org.json.

#activitypub #mastodev

4 comments
Gregory

Oh and I also made a pull request to gson: github.com/google/gson/pull/19

Everyone was asking for this feature. Since 2008. SINCE 2008!!! But it was never added.

marius

@grishka does it allow for the jsonld ActivityPub idiosyncrasies? As in same property can be at times an object, a URL, a list of URLs or maybe even a list of objects. :D

Gregory

@mariusor nope, I don't use that feature for ActivityPub, I just use the tree model as before, but *in principle* it should be doable with some TypeAdaters.

Gregory

@mariusor and you need the tree anyway for all the LD stuff.

The cool part about the objects though is that this uses a streaming parser with no intermediate representation. So it goes straight from a reader (char stream) to object fields.

Go Up