{"openapi":"3.0.0","paths":{"/api/auth":{"post":{"operationId":"AuthController_login","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthData"}}}}},"tags":["Auth"]}},"/api/users":{"post":{"operationId":"UsersController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModel"}}}}},"tags":["Users"]},"get":{"operationId":"UsersController_findAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserModel"}}}}},"401":{"description":"Unauthorized"}},"tags":["Users"],"security":[{"bearer":[]}]}},"/api/users/admin":{"post":{"operationId":"UsersController_createAdmin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModel"}}}},"401":{"description":"Unauthorized"}},"tags":["Users"],"security":[{"bearer":[]}]}},"/api/users/{id}":{"get":{"operationId":"UsersController_findOne","parameters":[{"name":"id","required":true,"in":"path","example":"62d81ead14b1f43bf21f4711","schema":{"format":"/^[a-z0-9]{24}$/","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModel"}}}},"401":{"description":"Unauthorized"}},"tags":["Users"],"security":[{"bearer":[]}]},"patch":{"operationId":"UsersController_update","parameters":[{"name":"id","required":true,"in":"path","example":"62d81ead14b1f43bf21f4711","schema":{"format":"/^[a-z0-9]{24}$/","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModel"}}}},"401":{"description":"Unauthorized"}},"tags":["Users"],"security":[{"bearer":[]}]},"delete":{"operationId":"UsersController_remove","parameters":[{"name":"id","required":true,"in":"path","example":"62d81ead14b1f43bf21f4711","schema":{"format":"/^[a-z0-9]{24}$/","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModel"}}}},"401":{"description":"Unauthorized"}},"tags":["Users"],"security":[{"bearer":[]}]}},"/api/posts":{"post":{"operationId":"PostsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePostDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostModel"}}}},"401":{"description":"Unauthorized"}},"tags":["Posts"],"security":[{"bearer":[]}]},"get":{"operationId":"PostsController_findAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PostModel"}}}}},"401":{"description":"Unauthorized"}},"tags":["Posts"],"security":[{"bearer":[]}]}},"/api/posts/{id}":{"get":{"operationId":"PostsController_findOne","parameters":[{"name":"id","required":true,"in":"path","example":"62d81ead14b1f43bf21f4711","schema":{"format":"/^[a-z0-9]{24}$/","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostModel"}}}},"401":{"description":"Unauthorized"}},"tags":["Posts"],"security":[{"bearer":[]}]},"patch":{"operationId":"PostsController_update","parameters":[{"name":"id","required":true,"in":"path","example":"62d81ead14b1f43bf21f4711","schema":{"format":"/^[a-z0-9]{24}$/","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePostDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostModel"}}}},"401":{"description":"Unauthorized"}},"tags":["Posts"],"security":[{"bearer":[]}]},"delete":{"operationId":"PostsController_remove","parameters":[{"name":"id","required":true,"in":"path","example":"62d81ead14b1f43bf21f4711","schema":{"format":"/^[a-z0-9]{24}$/","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostModel"}}}},"401":{"description":"Unauthorized"}},"tags":["Posts"],"security":[{"bearer":[]}]}}},"info":{"title":"TECH POSTS BACKEND","description":"Api RESTful for post management","version":"0.0.1","contact":{}},"tags":[],"servers":[],"components":{"schemas":{"UserModel":{"type":"object","properties":{"_id":{"type":"string"},"avatar":{"type":"string"},"username":{"type":"string"},"name":{"type":"string"},"surname":{"type":"string"},"role":{"type":"string","enum":["admin","user"]},"createAt":{"format":"date-time","type":"string"},"updateAt":{"format":"date-time","type":"string"}},"required":["_id","avatar","username","name","surname","role","createAt","updateAt"]},"AuthData":{"type":"object","properties":{"accessToken":{"type":"string"},"user":{"$ref":"#/components/schemas/UserModel"}},"required":["accessToken","user"]},"CreateUserDto":{"type":"object","properties":{"avatar":{"type":"string"},"username":{"type":"string"},"name":{"type":"string"},"surname":{"type":"string"},"role":{"type":"string","enum":["admin","user"]}},"required":["username","name","surname"]},"UpdateUserDto":{"type":"object","properties":{"avatar":{"type":"string"},"username":{"type":"string"},"name":{"type":"string"},"surname":{"type":"string"},"role":{"type":"string","enum":["admin","user"]}}},"CreatePostDto":{"type":"object","properties":{"image":{"type":"string"},"message":{"type":"string"},"location":{"type":"string"}},"required":["message","location"]},"PostModel":{"type":"object","properties":{"_id":{"type":"string"},"image":{"type":"string"},"message":{"type":"string"},"likes":{"type":"array","items":{"$ref":"#/components/schemas/UserModel"}},"author":{"$ref":"#/components/schemas/UserModel"},"location":{"type":"string"},"status":{"type":"string","enum":["drafted","deleted","published"]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["_id","image","message","likes","author","location","status","createdAt","updatedAt"]},"UpdatePostDto":{"type":"object","properties":{"image":{"type":"string"},"message":{"type":"string"},"location":{"type":"string"},"status":{"type":"string"}},"required":["status"]}}}}