diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-08-06 17:20:54 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-08-06 17:20:54 -0300 |
commit | 8f57fbc04d2fa224a5a3fb4560da7ef9b91c202c (patch) | |
tree | 02dce93d0072287e01cb73d6d4fce1680c68be94 /src/leap/services/eip/eipspec.py | |
parent | d6bf9b3e11ff87488a5f508acebf8f20ad026166 (diff) | |
parent | d5ea34c797e56b05fc54a186cf6c998e036f4ed0 (diff) |
Merge remote-tracking branch 'ivan/feature/3310_add-support-for-multiple-schemas' into develop
Diffstat (limited to 'src/leap/services/eip/eipspec.py')
-rw-r--r-- | src/leap/services/eip/eipspec.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/leap/services/eip/eipspec.py b/src/leap/services/eip/eipspec.py index 94ba674f..9cc56be3 100644 --- a/src/leap/services/eip/eipspec.py +++ b/src/leap/services/eip/eipspec.py @@ -15,7 +15,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -eipservice_config_spec = { + +# Schemas dict +# To add a schema for a version you should follow the form: +# { '1': schema_v1, '2': schema_v2, ... etc } +# so for instance, to add the '2' version, you should do: +# eipservice_config_spec['2'] = schema_v2 +eipservice_config_spec = {} + +eipservice_config_spec['1'] = { 'description': 'sample eip service config', 'type': 'object', 'properties': { @@ -63,3 +71,15 @@ eipservice_config_spec = { } } } + + +def get_schema(version): + """ + Returns the schema corresponding to the version given. + + :param version: the version of the schema to get. + :type version: str + :rtype: dict or None if the version is not supported. + """ + schema = eipservice_config_spec.get(version, None) + return schema |