跳到主要内容
博客林节点api_spec()

api_spec()

引入一个新的API 调用:api_spec() - 它以机器可读的格式生成整个LinodeAPI 规范。 生成的结构包含所有API 类和方法,并包括方法参数、它们的描述、数据类型、默认值,以及可能抛出的错误。

在实现API 绑定或工具时,一个常见的问题是,最终会重复相同的类、方法、属性、类型验证和错误处理--这很繁琐,容易出错,而且在不修改代码的情况下,不能接收新的API 方法或参数。

通过以机器可读的格式提供API 规范,可以编写工具来检索结构并从结构的内容中动态地实现API 。 没有方法的硬编码。 没有硬编码的参数。 没有比特罗。

该电话不需要授权。

享受吧!
-冯小刚


评论 (2)

  1. Author Photo

    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.

  2. Author Photo

    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!

留下回复

您的电子邮件地址将不会被公布。 必须填写的字段被标记为*