Add api versionning

This commit is contained in:
Julien Duponchelle committed 2015-02-04 10:24:59 +01:00
1 parent 119bebee25
commit 08158884a4
3 files changed
+5 -4

No files matched your search

+2 -1
View File
@@ -84,7 +84,8 @@ class Route(object):
# This block is executed only the first time
output_schema = kw.get("output", {})
input_schema = kw.get("input", {})
cls._path = path
api_version = kw.get("version", 1)
cls._path = "/v{version}{path}".format(path=path, version=api_version)
cls._documentation.setdefault(cls._path, {"methods": []})
def register(func):