You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Bowl_in/Sources/API/Iris/docs/swagger.json

188 lines
5.9 KiB

{
"swagger": "2.0",
"info": {
"description": "A bowling scorer API. More infos on [https://codefirst.iut.uca.fr/git/BowlDev/Bowl_in]",
"title": "Bowl'in API",
"contact": {
"name": "VALIN Arthur",
"email": "arthur.valin@etu.uca.fr"
},
"version": "1.0"
},
"host": "localhost:8080",
"basePath": "/",
"paths": {
"/users": {
"get": {
"description": "Responds with the list of all users as JSON.",
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Get users array",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.User"
}
}
}
}
},
"post": {
"description": "Takes a user JSON and store in DB. Return saved JSON.",
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Store a new user",
"parameters": [
{
"description": "User JSON",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.User"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.User"
}
}
}
}
},
"/users/:id": {
"get": {
"description": "responds with the user whose ID value matches the id as JSON.",
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Get user by id",
"parameters": [
{
"type": "string",
"description": "search user by id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.User"
}
}
}
}
},
"put": {
"description": "takes a user JSON and updates user whose ID value matches id.",
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Update a user",
"parameters": [
{
"type": "string",
"description": "search user by id",
"name": "id",
"in": "path",
"required": true
},
{
"description": "User JSON",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.User"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.User"
}
}
}
},
"delete": {
"description": "delete user whose ID value matches id.",
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Delete a user",
"parameters": [
{
"type": "string",
"description": "delete user by id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "User successfully deleted",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"model.User": {
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
}
}
}