Allow value_meta to be None/Null

The API spec says value_meta is optional, so
allow none as a value. This change will also
match the java API.

Change-Id: Ibabff76b3f1592334c281f57a1a5b939bb11e1f8
This commit is contained in:
Ryan Brandt 2017-01-10 14:14:53 -07:00
parent 92e08671b9
commit 0a261ef5a2
1 changed files with 2 additions and 0 deletions

View File

@ -76,6 +76,8 @@ def validate_metric(metric):
def validate_value_meta(value_meta):
if value_meta is None:
return
if len(value_meta) > VALUE_META_MAX_NUMBER:
msg = "Too many valueMeta entries {0}, limit is {1}: valueMeta {2}".\
format(len(value_meta), VALUE_META_MAX_NUMBER, value_meta)