Jump to: navigation, search

OpenStack-SDK-PHP/Design/JSON-schema

< OpenStack-SDK-PHP
Revision as of 10:30, 8 April 2014 by Jamiehannaford (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

We've discussed several times the best way to define services in the SDK. These are our three options:

  1. JSON-schema
  2. Guzzle's DSL
  3. Hand-coding everything


Based on our discussions, we seem to have agreed that JSON schemas were the best options, because:

  • It's a standard format that lots of APIs use, including: OpenStack Glance, OpenStack Keystone (future), Google Discovery API, Heroku
  • It's being implemented into OpenStack common soon
  • It avoids duplication
  • It allows us to RAPIDLY implement new features. For example, I defined the Compute API in 1 day. To do that in normal code would have take 3-5 days.
  • As we add new features, we don't need to write new unit tests because the parsing feature is already fully tested
  • It's more scalable and responsive


A parsing feature should:

  • Validate data according to a schema
  • Consume remote schemas (from an API) or local schema files
  • Parse data into models objects for users to use