go-fed/activity

Do not overwrite existing @context in serialization

cjslep opened this issue · 1 comments

In util.go, I added a TODO about overwriting the existing @context if it exists.

Unfortunately we must live in a world where users of the library will attempt the very highly discouraged practice to side-load additional "unknown" fields and set portions of the @context already.

This improvement will also help future-proof the code if something like manual @context setting gets first-class support.

I explored this and can safely say it breaks a lot of existing serialization/deserialization.

Since go-fed understands JSON-LD at code-generation time, there is no way to effectively merge two @context documents without re-building that understanding at code-compilation time.

Closing without solving.