openshift-mobile/openshift-mobile — pull request #134 by jyore (2014-10-05 02:15:01+00:00)
Title: Externalize API Versioning

This pull request externalizes the api version URL config to json files that are loaded when the framework or user sets the api version. This allows for better maintainability than the previous implementation that was all inside the framework code.

A new version is specified by creating a json file with the name `vX.X.json`,ex. `v1.6.json`, in the `www/json/api/version` directory. Similarly, the json file should be placed in `www/json/api/enterprise` for OpenShift Enterprise specs.

The json object inside the file must:

1. be valid json (double quotes enforced)
1. specify an object for each app category supported (ex. domains,applications,cartridges,etc)
1. specify an object with actions and urls for each action supported under each category

Shote Example (see one of the provided api specs for full example):

{
"domains" : {
"list": "domains",
"delete" : "domain/",
"update" : "domain/",
"add" : "domains"
},
...
}

For data that varies, such as domain name, the tag notation `` can still be used and will be injected with the current available data.