{"spec":{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"eDraw diagram spec","type":"object","required":["nodes"],"properties":{"nodes":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","properties":{"key":{"type":"string","description":"Stable identifier used by edges and patches. Defaults to a slug of the label."},"type":{"type":"string","enum":["user","webapp","mobile","desktop","server","api","loadbalancer","microservice","database","cache","queue","storage","cloud","cdn","firewall","note","label","textbox","image","rectangle","circle","ellipse","triangle","diamond","hexagon","parallelogram","star"]},"label":{"type":"string","description":"Main text on the node"},"subtitle":{"type":"string"},"details":{"type":"string","description":"Bullet list, one bullet per line (\"Owns the order lifecycle\\nOnly writer to the orders table\"). Drawn in the box and repeated in the documentation. Write short lines, not a paragraph."},"color":{"type":"string","description":"Hex fill. Defaults to the palette colour for the type."},"textColor":{"type":"string"},"layout":{"type":"string","enum":["compact","card"]},"width":{"type":"number"},"height":{"type":"number"},"x":{"type":"number","description":"Pin the node here; auto-layout will not move it. Requires y."},"y":{"type":"number"}}}},"edges":{"type":"array","maxItems":2000,"items":{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","description":"Node key"},"to":{"type":"string","description":"Node key"},"label":{"type":"string"},"arrow":{"type":"string","enum":["none","end","both"],"default":"end"},"fromPort":{"type":"string","enum":["top","right","bottom","left"]},"toPort":{"type":"string","enum":["top","right","bottom","left"]}}}},"layout":{"type":"object","properties":{"direction":{"type":"string","enum":["LR","RL","TB","BT"],"default":"LR"},"gapX":{"type":"number"},"gapY":{"type":"number"}}},"artboard":{"description":"Page the diagram sits on. Omit to auto-fit, or false for none.","oneOf":[{"type":"string","enum":["A4","A4-landscape","A5","A5-landscape","A3","A3-landscape","Letter","Letter-landscape","Legal","Legal-landscape","1080p","4K","custom"]},{"type":"object","properties":{"size":{"type":"string","enum":["A4","A4-landscape","A5","A5-landscape","A3","A3-landscape","Letter","Letter-landscape","Legal","Legal-landscape","1080p","4K","custom"]},"width":{"type":"number"},"height":{"type":"number"},"bgColor":{"type":"string"}}},{"type":"boolean"}]}}},"patch":{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"eDraw patch","type":"object","required":["ops"],"properties":{"expectedUpdatedAt":{"type":"string","description":"Optimistic lock. If set and the diagram changed since, the patch is rejected with 409."},"regenerateDoc":{"type":"boolean","description":"Regenerate the stored documentation after applying (default true)."},"ops":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","required":["op"],"properties":{"op":{"type":"string","enum":["addNode","updateNode","removeNode","moveNode","addEdge","updateEdge","removeEdge","setTitle","relayout","setArtboard","clear"]}}}}},"examples":[{"ops":[{"op":"addNode","node":{"key":"redis","type":"cache","label":"Redis","subtitle":"session store"}},{"op":"addEdge","from":"api","to":"redis","label":"GET/SET"},{"op":"updateNode","key":"api","set":{"subtitle":"v2"}},{"op":"relayout","direction":"LR"}]}]}}