template-json.json 1.8 KB

1234567891011121314151617181920212223242526272829
  1. {
  2. "name": "verify-template-json",
  3. "nodes": [
  4. {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
  5. {"id": "n2", "name": "Fixture", "type": "code", "position": {"x": 0, "y": 100},
  6. "config": {"code": "return { name: 'Ada', payload: '{\"nested\":{\"count\":7}}' };"}},
  7. {"id": "n3", "name": "Parse", "type": "json", "position": {"x": -100, "y": 200},
  8. "config": {"operation": "parse", "inputField": "data.result.payload", "outputField": "value"}},
  9. {"id": "n4", "name": "Extract", "type": "json", "position": {"x": -100, "y": 300},
  10. "config": {"operation": "extract", "inputField": "data.value", "path": "nested.count", "outputField": "count"}},
  11. {"id": "n5", "name": "Bad", "type": "json", "position": {"x": 100, "y": 200},
  12. "config": {"operation": "parse", "inputField": "data.result.name", "outputField": "value", "onError": "null"}},
  13. {"id": "n6", "name": "Render", "type": "template", "position": {"x": 0, "y": 400},
  14. "config": {"template": "Hello {{data.result.name}}", "outputField": "text"}}
  15. ],
  16. "connections": [
  17. {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "n2", "targetInput": "data"},
  18. {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "n3", "targetInput": "data"},
  19. {"sourceNodeId": "n3", "sourceOutput": "main", "targetNodeId": "n4", "targetInput": "data"},
  20. {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "n5", "targetInput": "data"},
  21. {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "n6", "targetInput": "data"}
  22. ],
  23. "expect": {
  24. "n3": {"status": "completed", "output": {"value": {"nested": {"count": 7}}}},
  25. "n4": {"status": "completed", "output": {"count": 7}},
  26. "n5": {"status": "completed", "output": {"value": null}},
  27. "n6": {"status": "completed", "output": {"text": "Hello Ada"}}
  28. }
  29. }