Problem/Motivation

I wanted to use this module to examine the default resources provided by services and commerce_services modules but this module spit out a ton of backtraces in commerce kickstart and what did display was unusable because specific resource method names and descriptions were missing. I also didn't want anything special or customized so implementing a module just to easily read the API didn't make sense to me.

Proposed resolution

The provided patch extracts basic information from the services schema itself when it isn't present in the services_documentation hooks. This also gives a basic starting point at which to enhance documentation instead of writing it from scratch.

Remaining tasks

(reviews needed, tests to be written or run, documentation to be written, etc.)
Documentation should be modified to note this new baseline behavior.
Code reviews are encouraged paying special attention to the fact that I refactored a misspelled function name.

User interface changes

None.

API changes

None.

None.

Original report by [username]

None.

Comments

ben.bunk’s picture

Oh it's worth noting I threw in a couple if ( is_array ) checks inside the nested foreach's because those would throw php warnings regardless of this patch because not all elements being looped over are arrays. If error reporting is cranked down this isn't an issue obviously.

wodenx’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
StatusFileSize
new5.57 KB

Giving this a bump - the existing patch is now quite out of date.

Attached patch provides a default documentation callback when none is specified for a resource. It also passes the $method array to any existing callbacks. This allows a module to define a single callback to process many similar methods.

brianbarker’s picture

I would love this module to work because it is hella frustrating trying to figure out what to pass into the services apis. This patch seems to be heading in the right direction, so thanks! However, it does have some issues. There are a few warnings about missing indexes like '#verb'. More crucially, when I try to view the documentation for my endpoint the request runs for minutes and a page is never generated. MAMP then blows up the RAM usage on my laptop.

I peeked at the code for awhile, but I didn't have time to dig in and really figure out what's going on. Again, if this module could work efficiently out of the box, I would be VERY appreciative!

grasmash’s picture

Issue summary: View changes
Status: Needs review » Fixed

I've made some changes to the 1.x-dev version that create a UI for entering documentation. Default documentation is also generated for operations. Take a look and reopen if you have further issues.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.