Merge pull request #2225 from mnowster/2221-blank-env-vars

2221 allow empty environment keys
This commit is contained in:
Daniel Nephin 2015-10-19 14:06:31 -04:00
commit 3725c3ab7e
3 changed files with 19 additions and 3 deletions

View file

@ -41,7 +41,7 @@
"type": "object",
"patternProperties": {
"^[^-]+$": {
"type": ["string", "number", "boolean"],
"type": ["string", "number", "boolean", "null"],
"format": "environment"
}
},

View file

@ -136,7 +136,7 @@ def process_errors(errors, service_name=None):
if len(validator) >= 2:
first_type = anglicize_validator(validator[0])
last_type = anglicize_validator(validator[-1])
types_from_validator = "{}{}".format(first_type, ", ".join(validator[1:-1]))
types_from_validator = ", ".join([first_type] + validator[1:-1])
msg = "{} or {}".format(
types_from_validator,
@ -156,7 +156,6 @@ def process_errors(errors, service_name=None):
Inspecting the context value of a ValidationError gives us information about
which sub schema failed and which kind of error it is.
"""
required = [context for context in error.context if context.validator == 'required']
if required:
return required[0].message