code: public static JsonObject serialize(InstanceContext context) {
      return serialize(context.uri(), context.component().network());
    }
docs: Serializes an instance context to JSON.
  
  @param context The context to serialize.
  @return The serialized context.