Merge "Apply input schema to workflow/action input"

This commit is contained in:
Jenkins 2015-04-17 08:51:54 +00:00 committed by Gerrit Code Review
commit f9357309c2
4 changed files with 14 additions and 4 deletions

View File

@ -75,7 +75,12 @@ class ActionSpecValidation(base.WorkbookSpecValidationTestCase):
({'input': ['']}, True),
({'input': None}, True),
({'input': ['k1', 'k2']}, False),
({'input': ['k1', 12345]}, True)
({'input': ['k1', 12345]}, True),
({'input': ['k1', {'k2': 2}]}, False),
({'input': [{'k1': 1}, {'k2': 2}]}, False),
({'input': [{'k1': None}]}, False),
({'input': [{'k1': 1}, {'k1': 1}]}, True),
({'input': [{'k1': 1, 'k2': 2}]}, True)
]
actions = {

View File

@ -132,7 +132,12 @@ class WorkflowSpecValidation(base.WorkflowSpecValidationTestCase):
({'input': [None]}, True),
({'input': ['']}, True),
({'input': None}, True),
({'input': []}, True)
({'input': []}, True),
({'input': ['var1', {'var2': 2}]}, False),
({'input': [{'var1': 1}, {'var2': 2}]}, False),
({'input': [{'var1': None}]}, False),
({'input': [{'var1': 1}, {'var1': 1}]}, True),
({'input': [{'var1': 1, 'var2': 2}]}, True)
]
for wf_input, expect_error in tests:

View File

@ -27,7 +27,7 @@ class ActionSpec(base.BaseSpec):
"properties": {
"base": types.NONEMPTY_STRING,
"base-input": types.NONEMPTY_DICT,
"input": types.UNIQUE_STRING_LIST,
"input": types.UNIQUE_STRING_OR_ONE_KEY_DICT_LIST,
"output": types.ANY_NULLABLE,
},
"required": ["base"],

View File

@ -37,7 +37,7 @@ class WorkflowSpec(base.BaseSpec):
"properties": {
"type": types.WORKFLOW_TYPE,
"task-defaults": _task_defaults_schema,
"input": types.UNIQUE_STRING_LIST,
"input": types.UNIQUE_STRING_OR_ONE_KEY_DICT_LIST,
"output": types.NONEMPTY_DICT,
"tasks": {
"type": "object",