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

Method validate

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

Source from the content-addressed store, hash-verified

365
366 @staticmethod
367 def validate(input, spec):
368 if not input and (not spec.get("required", None) or spec.get("default", None)):
369 return
370
371 for m in re.finditer(r"[^, ]+", input):
372 index, item = m.start(), m.group()
373 try:
374 EnumReader.validate(item, spec.get("items", {}))
375 except validation.ValidationError as e:
376 raise validation.ValidationError(index, six.text_type(e))
377
378 def _construct_template(self):
379 self.template = "{0}: "

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
startMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected