Introducing a new API call: api_spec() – which generates the entire Linode API specification in machine readable format. The structure generated contains all API classes and methods, and includes method parameters, their descriptions, data types, default values, and what errors may be thrown.
A common problem when implementing API bindings or tools is that one ends up duplicating the same classes, methods, properties, type validations, and error handling – which is tedious and error prone, and doesn’t receive new API methods or parameters without the code changes.
By making the API specification available in machine readable format, tools can be written to retrieve the structure and dynamically implement the API from the structure’s contents. No hard coding of methods. No hard coding of params. No bitrot.
The call does not require authorization.
Enjoy!
-Chris
Comments (2)
Nice, I’ll have to check this out. Perhaps it will make writing a Drupal module easier, as well as implimenting custom php functions to call and validate Linode api calls.
Anything that makes writing Drupal modules easier has to be a good thing 🙂
Good job folks, I will find that handy in the coming months of development!