39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
# File 'lib/steplib/workflow_validator.rb', line 39
def validate_workflow_step!(workflow_step_data)
HashUtils.check_required_attributes_and_types!(workflow_step_data, [
['position_in_workflow', Fixnum],
['is_always_run', ABooleanValue],
['id', String],
['steplib_source', String],
['version_tag', String],
['name', String],
['description', String],
['website', String],
['fork_url', String],
['source', Hash],
['host_os_tags', Array],
['project_type_tags', Array],
['type_tags', Array],
['is_requires_admin_user', ABooleanValue],
['inputs', Array],
['outputs', Array],
])
workflow_step_data = HashUtils.set_missing_defaults(
workflow_step_data,
[{key: 'icon_url_256', value: nil}])
HashUtils.check_required_attributes_and_types!(workflow_step_data['source'], [
['git', String]
])
a_host_os_tags = workflow_step_data['host_os_tags']
a_host_os_tags.each { |a_tag|
raise "Invalid host-os-tag (#{a_tag}), not a String (class: #{a_tag.class})!" unless a_tag.is_a? String
}
a_project_type_tags = workflow_step_data['project_type_tags']
a_project_type_tags.each { |a_tag|
raise "Invalid project-type-tag (#{a_tag}), not a String (class: #{a_tag.class})!" unless a_tag.is_a? String
}
a_type_tags = workflow_step_data['type_tags']
a_type_tags.each { |a_tag|
raise "Invalid type-tag (#{a_tag}), not a String (class: #{a_tag.class})!" unless a_tag.is_a? String
}
a_inputs = workflow_step_data['inputs']
a_inputs.each do |a_input_itm|
HashUtils.check_required_attributes_and_types!(a_input_itm, [
['title', String],
['description', String],
['mapped_to', String],
['is_expand', ABooleanValue],
['is_required', ABooleanValue],
['value_options', Array],
['value', String],
['is_dont_change_value', ABooleanValue]
])
a_value_options = a_input_itm['value_options']
a_value_options.each { |a_value_option|
raise "Invalid value-option (#{a_value_option}), not a String (class: #{a_value_option.class})!" unless a_value_option.is_a? String
}
end
a_outputs = workflow_step_data['outputs']
a_outputs.each do |a_output_itm|
HashUtils.check_required_attributes_and_types!(a_output_itm, [
['title', String],
['description', String],
['mapped_to', String]
])
end
end
|