{"swagger":"2.0","info":{"version":"1.0","title":"1502app","description":""},"paths":{"/login":{"post":{"description":"Login user","tags":["User"],"parameters":[{"in":"body","name":"body","required":true,"schema":{"properties":{"login":{"type":"string"},"password":{"type":"string"}}}}],"responses":{"200":{"schema":{"properties":{"token":{"type":"string"}}},"description":"OK"},"403":{"schema":{"properties":{"error":{"type":"string"}}},"description":"Wrong password"}}}},"/user":{"post":{"description":"Creates user","tags":["User"],"parameters":[{"in":"header","description":"Authorization token with admin privileges","name":"Authorization","type":"string","required":true},{"in":"body","name":"body","required":true,"schema":{"properties":{"login":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"class_letter":{"type":"string"},"class_number":{"type":"integer"},"status":{"type":"string"},"profile_pic":{"type":"string"},"password":{"type":"string"}}}}],"responses":{"200":{"description":"OK"},"401":{"schema":{"properties":{"error":{"type":"string"}}},"description":"Token without admin privileges"}}},"get":{"description":"Get current user","tags":["User"],"parameters":[{"in":"header","description":"Authorization token","name":"Authorization","type":"string","required":true}],"responses":{"200":{"schema":{"properties":{"id":{"type":"integer"},"login":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"class_letter":{"type":"string"},"class_number":{"type":"integer"},"status":{"type":"string"},"profile_pic":{"type":"string"}}},"description":"OK"}}}},"/user/{id}":{"get":{"description":"Get user by id","tags":["User"],"parameters":[{"in":"header","description":"Authorization token","name":"Authorization","type":"string","required":true},{"in":"path","name":"id","type":"integer","required":true}],"responses":{"200":{"schema":{"properties":{"id":{"type":"integer"},"login":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"class_letter":{"type":"string"},"class_number":{"type":"integer"},"status":{"type":"string"},"profile_pic":{"type":"string"}}},"description":"OK"}}}},"/post":{"post":{"description":"Creates new post","tags":["Post"],"parameters":[{"in":"header","description":"Authorization token with admin privileges","name":"Authorization","type":"string","required":true},{"in":"body","name":"body","required":true,"schema":{"properties":{"text":{"type":"string"},"images":{"type":"array","items":{"type":"string"}},"creator":{"type":"integer"}}}}],"responses":{"200":{"description":"OK"}}},"get":{"description":"Get last posts","tags":["Post"],"parameters":[{"in":"header","description":"Authorization token","name":"Authorization","type":"string","required":true},{"in":"query","name":"number","default":20,"type":"integer"},{"in":"query","name":"from","default":0,"type":"integer"}],"responses":{"200":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"likes":{"type":"integer"},"liked":{"type":"boolean"},"text":{"type":"string"},"images":{"type":"array","items":{"type":"string"}},"creator":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"logo":{"type":"string"}}}}}},"description":"OK"}}}},"/post/{id}":{"get":{"description":"Get post by id","tags":["Post"],"parameters":[{"in":"header","description":"Authorization token","name":"Authorization","type":"string","required":true},{"in":"path","name":"id","type":"integer","required":true}],"responses":{"200":{"schema":{"properties":{"id":{"type":"integer"},"likes":{"type":"integer"},"liked":{"type":"boolean"},"text":{"type":"string"},"images":{"type":"array","items":{"type":"string"}},"creator":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"logo":{"type":"string"}}}}},"description":"OK"}}}},"/group":{"post":{"description":"Creates new group","tags":["Group"],"parameters":[{"in":"header","description":"Authorization token with admin privileges","name":"Authorization","type":"string","required":true},{"in":"body","name":"body","required":true,"schema":{"properties":{"title":{"type":"string"},"logo":{"type":"string"}}}}],"responses":{"200":{"description":"OK"}}}},"/group/{id}":{"get":{"description":"Get group by id","tags":["Group"],"parameters":[{"in":"header","description":"Authorization token","name":"Authorization","type":"string","required":true},{"in":"path","name":"id","type":"integer","required":true}],"responses":{"200":{"schema":{"properties":{"id":{"type":"integer"},"title":{"type":"string"},"posts":{"type":"array","items":{"type":"object","properties":{"likes":{"type":"integer"},"liked":{"type":"boolean"},"text":{"type":"string"},"images":{"type":"array","items":{"type":"string"}},"creator":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"logo":{"type":"string"}}}}}}}},"description":"OK"}}}}}}