esim.es2p: Permit ApiParamInteger to be an actual integer
Usually, the specifications say that the integer type is actually transmitted as a JSON string type. However, it seems some implementations do return a native JSON integer type. Let's be tolerant in that regard. Change-Id: I5b47f8bba01225d53eff2ca086e53a2133abed7f
This commit is contained in:
@@ -86,6 +86,8 @@ class ApiParamInteger(ApiParam):
|
||||
|
||||
@classmethod
|
||||
def verify_encoded(cls, data):
|
||||
if isinstance(data, int):
|
||||
return
|
||||
if not data.isdecimal():
|
||||
raise ValueError('integer (%s) contains non-decimal characters' % data)
|
||||
assert str(int(data)) == data
|
||||
|
||||
Reference in New Issue
Block a user