MCPcopy Create free account
hub / github.com/StackStorm/st2 / cast_argument_value

Function cast_argument_value

st2common/st2common/models/api/base.py:173–184  ·  view source on GitHub ↗
(value_type, value)

Source from the content-addressed store, hash-verified

171
172
173def cast_argument_value(value_type, value):
174 if value_type == bool:
175
176 def cast_func(value):
177 value = str(value)
178 return value.lower() in ["1", "true"]
179
180 else:
181 cast_func = value_type
182
183 result = cast_func(value)
184 return result

Callers 1

postMethod · 0.90

Calls 1

cast_funcFunction · 0.85

Tested by

no test coverage detected