[asterisk-commits] dlee: branch dlee/record r389963 - /team/dlee/record/rest-api-templates/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue May 28 16:31:56 CDT 2013
Author: dlee
Date: Tue May 28 16:31:53 2013
New Revision: 389963
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389963
Log:
Correct the checking for min/max fields in a range
Modified:
team/dlee/record/rest-api-templates/swagger_model.py
Modified: team/dlee/record/rest-api-templates/swagger_model.py
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record/rest-api-templates/swagger_model.py?view=diff&rev=389963&r1=389962&r2=389963
==============================================================================
--- team/dlee/record/rest-api-templates/swagger_model.py (original)
+++ team/dlee/record/rest-api-templates/swagger_model.py Tue May 28 16:31:53 2013
@@ -128,11 +128,9 @@
value_type = json['valueType']
if value_type == 'RANGE':
- if not 'min' in json:
- raise SwaggerError("Missing field min", context)
- if not 'max' in json:
- raise SwaggerError("Missing field max", context)
- return AllowableRange(json['min'], json['max'])
+ if not 'min' in json and not 'max' in json:
+ raise SwaggerError("Missing fields min/max", context)
+ return AllowableRange(json.get('min'), json.get('max'))
if value_type == 'LIST':
if not 'values' in json:
raise SwaggerError("Missing field values", context)
More information about the asterisk-commits
mailing list