(input, spec)
| 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") |