OpenStack-SDK-PHP/Design/JSON-schema
< OpenStack-SDK-PHP
Revision as of 10:30, 8 April 2014 by Jamiehannaford (talk | contribs)
We've discussed several times the best way to define services in the SDK. These are our three options:
- JSON-schema
- Guzzle's DSL
- 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