JSON REST API: Version 0.8
Hi everyone! Sorry about the late release, I’ve been a bit sick for most of the week, which has helped my blogging abilities but hindered my coding abilities. In any event, version 0.8 of the JSON REST API is now available.
As always, here’s what’s changed:
Add compatibility layer for JsonSerializable. You can now return arbitrary
objects from endpoints and use the
jsonSerialize()method to return the data
to serialize instead of just using the properties of the object.
Fix page parent links to use
Removed unneeded executable bit on all files
Don’t include the
featured_imageproperty for post types that don’t
plugins_loadedin the Extending
documentation for plugins
Parse the avatar URL from the
get_avatar()function in core, allowing custom
Ensure that the author is set if passed
Clarify the usage of
Ensure JSON disabled error messages are translated
Remove extra “Link: ” from link headers
The big change this week is the introduction of JsonSerializable support for all versions of PHP. This allows more complex APIs to return full objects and ensure that no data leaks via the API. This should help with reuse of the API internally, as you can now return objects with methods, private data, etc. It’s also a key stepping stone towards adding response objects, which should land in version 0.9.
For those that have been following along, you may notice that OAuth authentication has been bumped to 0.9. The implementation of OAuth has been a bit of a thorny one, so we’re still deciding some of the implementation for this. Given the size and scope of authentication, we don’t want to rush anything this important. That said, however, I’m aiming to push out both versions 0.9 and 1.0 in the next week to meet our Christmas deadline for version 1.0. This will result in a bit of rescheduling, but shouldn’t be a major concern.
We’re also desperately seeking help with testing the plugin. Unfortunately, while many of us are familiar with unit testing and can write the tests easily, the framework for doing so is evading us. If anyone can help us set up a testing framework, your help would be greatly appreciated.