{"openapi":"3.0.0","info":{"version":"1.0.0","title":"API Testing","description":"API documentation Testing"},"components":{"schemas":{"task":{"type":"object","properties":{"id":{"type":"number"},"task":{"type":"string","maxLength":255},"priority":{"type":"string","enum":["low","medium","high"]},"done":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"due":{"type":"string","format":"date"}},"required":["id","task","priority","done","createdAt","due"]}},"parameters":{}},"paths":{"/api/tasks":{"get":{"tags":["Tasks"],"description":"List all tasks","parameters":[{"schema":{"type":"number","nullable":true,"default":5},"required":false,"in":"query","name":"total","style":"simple"},{"schema":{"type":"string","enum":["any","low","medium","high"],"default":"any"},"required":false,"in":"query","name":"priority","style":"simple","description":"get by priority status"},{"schema":{"type":"string","enum":["asc","desc"],"default":"asc"},"required":false,"in":"query","name":"sort","style":"simple","description":"sort result by id"},{"schema":{"type":"boolean","nullable":true,"default":null},"required":false,"in":"query","name":"done","style":"simple","description":"get by done status","allowReserved":true},{"schema":{"type":"number","nullable":true,"default":1},"required":false,"in":"query","name":"page","style":"simple","description":"page number for pagination"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/task"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","default":false},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":"string","example":"Not Found"}},"required":["success","message"]}}}}}},"post":{"tags":["Tasks"],"description":"Add a new task","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"string","maxLength":255,"example":"Task Name"},"priority":{"type":"string","enum":["low","medium","high"],"default":"low"},"done":{"type":"boolean","default":false},"due":{"type":"string","format":"date","default":"now"}},"required":["task"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/task"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","default":false},"message":{"type":"string"}},"required":["message"]}}}}}}},"/api/tasks/{id}":{"get":{"tags":["Tasks"],"description":"Get task by id","parameters":[{"schema":{"type":"number","nullable":true},"required":true,"in":"path","name":"id","style":"matrix"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/task"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","default":false},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":"string","example":"Not Found"}},"required":["success","message"]}}}}}},"patch":{"tags":["Tasks"],"description":"Update task by id","parameters":[{"schema":{"type":"number","nullable":true},"required":false,"in":"path","name":"id"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"string","maxLength":255,"example":"Updated Task Name"},"priority":{"type":"string","enum":["low","medium","high"]},"done":{"type":"boolean"},"due":{"type":"string","format":"date","default":"1970-01-01"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/task"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","default":false},"message":{"type":"string"}},"required":["message"]}}}}}},"delete":{"tags":["Tasks"],"description":"Delete task by id","parameters":[{"schema":{"type":"number","nullable":true},"required":true,"in":"path","name":"id","style":"matrix"}],"responses":{"200":{"description":"Response...","content":{"application/json":{"schema":{"$ref":"#/components/schemas/task"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","default":false},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":"string","example":"Not Found"}},"required":["success","message"]}}}}}}}}}