{"openapi":"3.1.0","info":{"title":"crocket-todo","version":"1.0.0","description":"Todos and notes. Sign up with an email and a password. This process signs short-lived HS256 JWTs and crocket::auth checks them, so there's no external identity provider."},"paths":{"/stats":{"get":{"tags":["api"],"summary":"Stats","operationId":"api.stats","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsBody"}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/auth/signup":{"post":{"tags":["api"],"summary":"Signup","operationId":"api.signup","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credentials"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"415":{"description":"Unsupported Media Type: the body is not application/json","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Content: the body is not valid JSON for this operation, or fails validation","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/auth/login":{"post":{"tags":["api"],"summary":"Login","operationId":"api.login","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credentials"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"415":{"description":"Unsupported Media Type: the body is not application/json","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Content: the body is not valid JSON for this operation, or fails validation","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/me":{"get":{"tags":["api"],"summary":"Me","operationId":"api.me","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Unauthorized: the bearer token is missing or not valid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"bearer":[]}]}},"/todos":{"get":{"tags":["api"],"summary":"List","operationId":"api.list","parameters":[{"name":"done","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Todo"}}}}},"401":{"description":"Unauthorized: the bearer token is missing or not valid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Content: a query parameter is missing or not valid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"bearer":[]}]},"post":{"tags":["api"],"summary":"Create","operationId":"api.create","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TodoInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Todo"}}}},"401":{"description":"Unauthorized: the bearer token is missing or not valid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"Unsupported Media Type: the body is not application/json","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Content: the body is not valid JSON for this operation, or fails validation","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"bearer":[]}]}},"/todos/{id}":{"get":{"tags":["api"],"summary":"Get","operationId":"api.get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Todo"}}}},"401":{"description":"Unauthorized: the bearer token is missing or not valid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found: nothing found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"bearer":[]}]},"put":{"tags":["api"],"summary":"Replace","operationId":"api.replace","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TodoInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Todo"}}}},"401":{"description":"Unauthorized: the bearer token is missing or not valid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found: nothing found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"Unsupported Media Type: the body is not application/json","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Content: the body is not valid JSON for this operation, or fails validation","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"bearer":[]}]},"delete":{"tags":["api"],"summary":"Remove","operationId":"api.remove","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"No Content"},"401":{"description":"Unauthorized: the bearer token is missing or not valid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found: nothing found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"bearer":[]}]}},"/healthz":{"get":{"tags":["crocket"],"summary":"Healthz","operationId":"crocket.healthz","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}}}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/readyz":{"get":{"tags":["crocket"],"summary":"Readyz","operationId":"crocket.readyz","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ready"]}}}}}},"503":{"description":"Not ready, or draining","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["not_ready","draining"]}}}}}},"default":{"description":"An error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"schemas":{"Problem":{"type":"object","description":"An error, as RFC 9457 problem details","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"code":{"type":"string","description":"Stable, for programs: json.invalid"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"pointer":{"type":"string"},"detail":{"type":"string"}}}}},"required":["title","status","detail","code"]},"CrocketBuild":{"type":"object","properties":{"version":{"type":"string"},"commit":{"type":"string"},"compiler":{"type":"string"}},"required":["version","commit","compiler"]},"StatsBody":{"type":"object","properties":{"rss_bytes":{"type":"integer","format":"uint64","minimum":0},"uptime_seconds":{"type":"integer","format":"int64"},"crocket":{"$ref":"#/components/schemas/CrocketBuild"}},"required":["crocket"]},"Credentials":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"password":{"type":"string","minLength":10,"maxLength":128}},"required":["email","password"],"additionalProperties":false},"PublicUser":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"email":{"type":"string"}},"required":["email"]},"Session":{"type":"object","properties":{"token":{"type":"string"},"expires_in":{"type":"integer","format":"int64"},"user":{"$ref":"#/components/schemas/PublicUser"}},"required":["token","user"]},"Me":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"email":{"type":"string"}},"required":["email"]},"Todo":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"user_id":{"type":"integer","format":"int64"},"title":{"type":"string"},"body":{"type":"string"},"done":{"type":"boolean"},"due_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["title","body","created_at","updated_at"]},"TodoInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","maxLength":8000},"done":{"type":"boolean"},"due_at":{"type":["string","null"]}},"required":["title"],"additionalProperties":false}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}}}