Merge "Apply input schema to workflow/action input"
This commit is contained in:
commit
f9357309c2
@ -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 = {
|
||||
|
@ -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:
|
||||
|
@ -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"],
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user