+{"openapi":"3.0.1","info":{"version":"1.0.0","title":"RDS API documentation","description":"This is documentation for Real Dev Squad's API. Find out more about Real dev squad at [http://realdevsquad.com](http://realdevsquad.com)","contact":{"name":"Real Dev Squad","url":"http://realdevsquad.com"}},"tags":[{"name":"Healthcheck","description":"API for health check in the system"},{"name":"Authentication","description":"Authentication routes"}],"servers":[{"url":"http://localhost:3000","description":"Local server URL"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"healthCheck":{"type":"object","properties":{"uptime":{"type":"number"}}},"challenges":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"level":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"is_active":{"type":"boolean"},"participants":{"type":"array","items":[]}}},"pullRequests":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string"},"state":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"readyForReview":{"type":"boolean"},"labels":{"type":"array","items":[]},"assignees":{"type":"array","items":[]}}},"users":{"type":"object","properties":{"username":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"yoe":{"type":"number"},"company":{"type":"string"},"designation":{"type":"string"},"img":{"type":"string"},"github_display_name":{"type":"string"},"github_id":{"type":"string"},"linkedin_id":{"type":"string"},"twitter_id":{"type":"string"},"instagram_id":{"type":"string"},"site":{"type":"string"},"isMember":{"type":"boolean"},"tokens":{"type":"object"}}},"errors":{"unAuthorized":{"type":"object","properties":{"statusCode":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"}}},"notFound":{"type":"object","properties":{"statusCode":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"}}},"forbidden":{"type":"object","properties":{"statusCode":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"}}},"badImplementation":{"type":"object","properties":{"statusCode":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"}}},"serverUnavailable":{"type":"object","properties":{"statusCode":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"paths":{"/auth/github/callback":{"get":{"summary":"Authenticates the user using the GitHub Oauth 2.0. Redirects to the UI on successful login","tags":["Authentication"],"parameters":[{"in":"query","name":"code","required":true,"type":"string","description":"Temporary code returned by GitHub Oauth"}],"responses":{"302":{"description":"Redirects to the UI on successful login","headers":{"Cookie":{"type":"string","description":"Cookie containing authentication token"},"Location":{"type":"string","description":"Redirection URL"}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/unAuthorized"}}}}}}},"/challenges":{"get":{"summary":"Used to get all the challenges","tags":["Challenges"],"responses":{"200":{"description":"Return challenges","content":{"application/json":{"schema":{"$ref":"#/components/schemas/challenges"}}}},"404":{"description":"No challenges found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/notFound"}}}},"503":{"description":"serverUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/serverUnavailable"}}}}}},"post":{"summary":"Post new challenge","tags":["Challenges"],"responses":{"200":{"description":"Post challenge","content":{"application/json":{"schema":{"$ref":"#/components/schemas/challenges"}}}},"404":{"description":"Unable to add challenge","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/notFound"}}}},"503":{"description":"serverUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/serverUnavailable"}}}}}}},"/challenges/subscribe":{"post":{"summary":"Subscribe user to challenge","tags":["Challenges"],"responses":{"200":{"description":"Subscribed sucessfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"User has subscribed to challenge"}}}}}},"404":{"description":"Unable to add challenge","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/notFound"}}}},"503":{"description":"serverUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/serverUnavailable"}}}}}}},"/healthcheck":{"get":{"summary":"Use to check health status of the server.","tags":["Healthcheck"],"responses":{"200":{"description":"Server uptime status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/healthCheck"}}}}}}},"/healthcheck/v2":{"get":{"summary":"Sample route to test authentication middleware.","tags":["Healthcheck"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Server uptime status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/healthCheck"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/unAuthorized"}}}}}}},"/members":{"get":{"summary":"Gets details of all the Real Dev Squad members","tags":["Members"],"responses":{"200":{"description":"Details of all the RDS members","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"500":{"description":"badImplementation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/badImplementation"}}}}}}},"/pullrequests/open":{"get":{"summary":"Latest 10 Pull Requests in Real Dev Squad","tags":["Pull Requests"],"responses":{"200":{"description":"Pull Requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Open PRs"},"pullRequests":{"type":"array","items":{"$ref":"#/components/schemas/pullRequests"}}}}}}},"500":{"description":"badImplementation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/badImplementation"}}}}}}},"/pullrequests/stale":{"get":{"summary":"All open Pull Requests in Real Dev Squad","tags":["Pull Requests"],"responses":{"200":{"description":"Pull Requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Stale PRs"},"pullRequests":{"type":"array","items":{"$ref":"#/components/schemas/pullRequests"}}}}}}},"500":{"description":"badImplementation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/badImplementation"}}}}}}},"/pullrequests/user/:username":{"get":{"summary":"Pull Requests by a user in Real Dev Squad","tags":["Pull Requests"],"responses":{"200":{"description":"Pull Requests","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Pull requests returned successfully!"},"pullRequests":{"type":"array","items":{"$ref":"#/components/schemas/pullRequests"}}}}}}},"500":{"description":"badImplementation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/badImplementation"}}}}}}},"/users":{"post":{"summary":"Create new user with provided data.","requestBody":{"description":"User data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"tags":["Users"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"User details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"401":{"description":"unAuthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/unAuthorized"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/forbidden"}}}},"404":{"description":"notFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/notFound"}}}},"503":{"description":"serverUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/serverUnavailable"}}}}}},"get":{"summary":"Get all the users in system.","tags":["Users"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"User details","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Users returned successfully!"},"users":{"type":"array","items":{"$ref":"#/components/schemas/users"}}}}}}},"401":{"description":"unAuthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/unAuthorized"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/forbidden"}}}},"404":{"description":"notFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/notFound"}}}},"503":{"description":"serverUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/serverUnavailable"}}}}}}},"/users/self":{"patch":{"summary":"Use to update the user data.","requestBody":{"description":"User data to be updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"tags":["Users"],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"No content"},"401":{"description":"unAuthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/unAuthorized"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/forbidden"}}}},"404":{"description":"notFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/notFound"}}}},"503":{"description":"serverUnavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/serverUnavailable"}}}}}},"get":{"summary":"Use to get self details.","tags":["Users"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"User details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"401":{"description":"unAuthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/unAuthorized"}}}},"404":{"description":"notFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/notFound"}}}},"500":{"description":"badImplementation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/badImplementation"}}}}}}},"/users/:username":{"get":{"summary":"Get the details of user with provided id.","tags":["Users"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"User details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/users"}}}},"401":{"description":"unAuthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/unAuthorized"}}}},"404":{"description":"notFound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/notFound"}}}},"500":{"description":"badImplementation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errors/badImplementation"}}}}}}}}}
0 commit comments