nextcloud / activity

:zap: Activity app for Nextcloud
117 stars 66 forks source link

Output of the API is not according to spec #330

Open rullzer opened 5 years ago

rullzer commented 5 years ago

See:

{
   "activity_id":12672,
   "app":"core",
   "type":"security",
   "user":"tobi",
   "subject":"You successfully logged in using two-factor authentication (Nextcloud Notification)",
   "subject_rich":[
      "",
      [

      ]
   ],
   "message":"",
   "message_rich":[
      "",
      [

      ]
   ],
   "object_type":"",
   "object_id":0,
   "object_name":"",
   "objects":[
      ""
   ],
   "link":"",
   "icon":"http://10.0.2.2/nc/core/img/actions/password.svg",
   "datetime":"2018-12-18T10:10:24+00:00",
   "previews":[

   ]
}

As you can see the 'objects' for example is an array. As are the second argument of subject_rich etc. According to the specs these should be objects.,

cc: @tobiasKaminsky

nickvergessen commented 5 years ago

Hmm this is because php json_encode([]) can't know if it is an empty string-key-based array or integer-key-based array.

Also objects is not documented and internal