{"openapi":"3.1.0","info":{"version":"1.0.0","title":"@shortiz/api","description":"Builders-stack reference API."},"components":{"schemas":{"WaitlistOk":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"WaitlistSignup":{"type":"object","properties":{"email":{"type":"string","maxLength":255,"format":"email","example":"ink@example.com"}},"required":["email"]},"Post":{"type":"object","properties":{"id":{"type":"string","example":"p_abc123"},"title":{"type":"string","example":"Hello world"},"body":{"type":"string","example":"My first post."},"authorId":{"type":"string","example":"u_abc123"},"createdAt":{"type":"string","format":"date-time","example":"2026-07-01T12:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","example":"2026-07-01T12:00:00.000Z"}},"required":["id","title","body","authorId","createdAt","updatedAt"]},"NewPost":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":255},"body":{"type":"string","minLength":1,"maxLength":100000}},"required":["title","body"]},"PatchPost":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":255},"body":{"type":"string","minLength":1,"maxLength":100000}}}},"parameters":{}},"paths":{"/waitlist":{"post":{"tags":["waitlist"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistSignup"}}}},"responses":{"200":{"description":"On the list (duplicates get the same answer)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistOk"}}}},"400":{"description":"Invalid email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts":{"get":{"tags":["posts"],"responses":{"200":{"description":"All posts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Post"}}}}}}},"post":{"tags":["posts"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPost"}}}},"responses":{"201":{"description":"Created post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts/{id}":{"get":{"tags":["posts"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["posts"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchPost"}}}},"responses":{"200":{"description":"Updated post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — not the author","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["posts"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden — not the author","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}