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

Method validate

st2client/st2client/utils/interactive.py:286–295  ·  view source on GitHub ↗
(input, spec)

Source from the content-addressed store, hash-verified

284
285 @staticmethod
286 def validate(input, spec):
287 if not input and (not spec.get("required", None) or spec.get("default", None)):
288 return
289
290 for m in re.finditer(r"[^, ]+", input):
291 index, item = m.start(), m.group()
292 try:
293 StringReader.validate(item, spec.get("items", {}))
294 except validation.ValidationError as e:
295 raise validation.ValidationError(index, six.text_type(e))
296
297 def read(self):
298 item_type = self.spec.get("items", {}).get("type", "string")

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
startMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected