-
Notifications
You must be signed in to change notification settings - Fork 0
/
api-docs.json
1 lines (1 loc) · 8.49 KB
/
api-docs.json
1
{"swagger":"2.0","info":{"description":"manage your tournament's teams and players","version":"1.0.0","title":"Players and Teams","termsOfService":"none","contact":{"name":"Bhavish Reddy","url":"https://github.com/sebhavish","email":"sebhavish@gmail.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}},"host":"localhost:8080","basePath":"/","tags":[{"name":"player-controller","description":"Player Controller"},{"name":"team-controller","description":"Team Controller"}],"paths":{"/api/player/allPlayers":{"get":{"tags":["player-controller"],"summary":"Get all players","description":"gives out all the players as response, based on the given page inputs","operationId":"getAllPlayersUsingGET","produces":["*/*"],"parameters":[{"name":"pageNo","in":"query","description":"pageNo","required":false,"type":"integer","default":0,"format":"int32"},{"name":"pageSize","in":"query","description":"pageSize","required":false,"type":"integer","default":5,"format":"int32"},{"name":"sortBy","in":"query","description":"sortBy","required":false,"type":"string","default":"id"},{"name":"sortDir","in":"query","description":"sortDir","required":false,"type":"string","default":"asc"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/player/delete/{id}":{"delete":{"tags":["player-controller"],"summary":"delete a player","description":"delete a player based on his id","operationId":"deletePlayerUsingDELETE","produces":["*/*"],"parameters":[{"name":"id","in":"path","description":"id","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"204":{"description":"No Content"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/api/player/getTeam/{id}":{"get":{"tags":["player-controller"],"summary":"get team of a player","description":"using the player id get his team details","operationId":"getTeamByPlayerIdUsingGET","produces":["*/*"],"parameters":[{"name":"id","in":"path","description":"id","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/player/update/{id}":{"put":{"tags":["player-controller"],"summary":"update player's details","description":"update the details of the player based on the player id","operationId":"updatePlayerUsingPUT","consumes":["application/json"],"produces":["*/*"],"parameters":[{"name":"id","in":"path","description":"id","required":true,"type":"integer","format":"int64"},{"in":"body","name":"player","description":"player","required":true,"schema":{"$ref":"#/definitions/players info"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/player/{id}":{"get":{"tags":["player-controller"],"summary":"Get the player using his id","description":"using the player id you can retrieve all the player information","operationId":"getPlayerByIdUsingGET","produces":["*/*"],"parameters":[{"name":"id","in":"path","description":"id","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/player/{teamId}/addPlayer":{"post":{"tags":["player-controller"],"summary":"add a player to team","description":"creates a player and add it to a team based on team id","operationId":"addPlayerUsingPOST","consumes":["application/json"],"produces":["*/*"],"parameters":[{"in":"body","name":"player","description":"player","required":true,"schema":{"$ref":"#/definitions/players info"}},{"name":"teamId","in":"path","description":"teamId","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/player/{teamId}/allPlayers":{"get":{"tags":["player-controller"],"summary":"get players of a team","description":"using the team id retrieve all players of team","operationId":"getAllPlayersByTeamIdUsingGET","produces":["*/*"],"parameters":[{"name":"teamId","in":"path","description":"teamId","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/team/allTeams":{"get":{"tags":["team-controller"],"summary":"Retrieve all teams","description":"gives out all teams, based on page inputs","operationId":"getAllTeamsUsingGET","produces":["*/*"],"parameters":[{"name":"pageNo","in":"query","description":"pageNo","required":false,"type":"integer","default":0,"format":"int32"},{"name":"pageSize","in":"query","description":"pageSize","required":false,"type":"integer","default":5,"format":"int32"},{"name":"sortBy","in":"query","description":"sortBy","required":false,"type":"string","default":"id"},{"name":"sortDir","in":"query","description":"sortDir","required":false,"type":"string","default":"asc"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/team/create":{"post":{"tags":["team-controller"],"summary":"creates a new team","description":"creates a new team","operationId":"createTeamUsingPOST","consumes":["application/json"],"produces":["*/*"],"parameters":[{"in":"body","name":"team","description":"team","required":true,"schema":{"$ref":"#/definitions/team's info"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/team/delete/{id}":{"delete":{"tags":["team-controller"],"summary":"delete a team","description":"delete a team and it's players based on team id","operationId":"deleteTeamUsingDELETE","produces":["*/*"],"parameters":[{"name":"id","in":"path","description":"id","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"204":{"description":"No Content"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/api/team/update/{id}":{"put":{"tags":["team-controller"],"summary":"update team","description":"updates team details based on it's id","operationId":"updateTeamUsingPUT","consumes":["application/json"],"produces":["*/*"],"parameters":[{"name":"id","in":"path","description":"id","required":true,"type":"integer","format":"int64"},{"in":"body","name":"team","description":"team","required":true,"schema":{"$ref":"#/definitions/team's info"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"201":{"description":"Created"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}},"/api/team/{id}":{"get":{"tags":["team-controller"],"summary":"get the team using id","description":"using the team id, gives out the team details","operationId":"getTeamByIdUsingGET","produces":["*/*"],"parameters":[{"name":"id","in":"path","description":"id","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ResponseWrapper"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}},"definitions":{"ResponseWrapper":{"type":"object","properties":{"data":{"type":"object"},"message":{"type":"string"},"result":{"type":"string"}},"title":"ResponseWrapper"},"players info":{"type":"object","properties":{"age":{"type":"integer","format":"int32","description":"player's age"},"name":{"type":"string","description":"player's name"},"playerType":{"type":"string"}},"title":"players info"},"team's info":{"type":"object","properties":{"location":{"type":"string","description":"location of the team"},"name":{"type":"string","description":"name of the team"}},"title":"team's info"}}}