{"openapi":"3.0.0","info":{"title":"API Documentation","description":"Documentation for your API","version":"1.0.0"},"paths":{"/register":{"post":{"summary":"Register a new user","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"200":{"description":"User registered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Bad request"}}}},"/login":{"post":{"summary":"Log in a user","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"200":{"description":"User logged in successfully","headers":{"Authorization":{"description":"Token for authentication","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Bad request"}}}},"/users":{"get":{"summary":"Get all users","tags":["User"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}},"401":{"description":"Unauthorized"},"404":{"description":"User not found"}}}},"/post":{"post":{"summary":"Create a new post","description":"Create a new post with the provided title and content.","tags":["Post"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}}}}},"/post-requests":{"get":{"summary":"Get all pending posts","tags":["Post"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Post"}}}}},"403":{"description":"Forbidden","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error"}}}},"/post-request":{"post":{"summary":"Update post status and user role","tags":["Post"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"responses":{"200":{"description":"Post updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"403":{"description":"Forbidden","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not Found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error"}}}},"/posts":{"get":{"summary":"Get posts","tags":["Post"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Post"}}}}},"500":{"description":"Internal Server Error"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"User":{"type":"object","properties":{"_id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"role":{"type":"string"}}},"Post":{"type":"object","properties":{"title":{"type":"string","description":"The title of the post.","example":"My Post Title"},"content":{"type":"string","description":"The content of the post.","example":"Lorem ipsum dolor sit amet..."},"author":{"type":"string","description":"The author of the post.","example":"John Doe"},"allowed":{"type":"boolean","description":"Specifies whether the post is allowed or not.","example":true}},"required":["title","content"]}}},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/MAGLICCUV_1/Zadatak-API/1.0.0"}]}