Commit 5bece2ab authored by Andrea Ruggiero's avatar Andrea Ruggiero
Browse files

Add documentation for new apis

parent bab7bba7
Pipeline #1457 failed with stage
in 1 minute and 8 seconds
......@@ -104,6 +104,270 @@
}
}
}
},
"/events" : {
"get" : {
"tags" : [ "Events" ],
"summary" : "/events",
"description" : "",
"operationId" : "GET_events",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "X-Auth-Token",
"in" : "header",
"description" : "",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "",
"schema" : {
"$ref" : "#/definitions/inline_response_200"
},
"examples" : {
"application/json" : {
"ok" : true,
"data": [
{
"id": 1,
"title": "???",
"speaker": "???",
"date": "2016-06-26",
"start": "02:30:00",
"end": "03:00:00",
"place": "Gym palace",
"type": "User digest",
"theme": "Technical",
"capacity": 127,
"bookings": 0,
"hasBooked": false
},
{
"id": 2,
"title": "(Dis)information-graphics – Problems, challenges and prospects of visual information in Wikipedia",
"speaker": "Martin Kraft",
"date": "2016-06-25",
"start": "04:30:00",
"end": "05:00:00",
"place": "Meeting",
"type": "Critical issue",
"theme": "Technical",
"capacity": 100,
"bookings": 1,
"hasBooked": true
}
]
}
}
},
"default" : {
"description" : "",
"schema" : {
"$ref" : "#/definitions/inline_response_default"
},
"examples" : {
"application/json" : {
"ok" : false,
"error" : "Errore generale"
}
}
}
}
}
},
"/event/{id}" : {
"post" : {
"tags" : [ "Events" ],
"summary" : "/event/{id}",
"description" : "",
"operationId" : "POST_event",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "X-Auth-Token",
"in" : "header",
"description" : "",
"required" : true,
"type" : "string"
},
{
"name" : "id",
"in" : "path",
"description" : "",
"required" : true,
"type" : "int"
}, {
"name" : "Content-Type",
"in" : "header",
"description" : "",
"required" : false,
"type" : "string",
"default" : " application/json"
} ],
"responses" : {
"200" : {
"description" : "",
"schema" : {
"$ref" : "#/definitions/inline_response_200"
},
"examples" : {
"application/json" : {
"ok": true,
"data": {
"event": {
"id": 70,
"title": "Wikipedia depicting Mohammed: Different approaches in different environments ",
"speaker": "Man77",
"date": "2016-06-25",
"start": "10:30:00",
"end": "11:00:00",
"place": "Theatre",
"address": "via Agueglio, Esino Lario",
"latitude": 45.99593,
"longitude": 9.3338,
"capacity": 100,
"type": "Critical issue",
"theme": "Outreach",
"bookings": 1,
"hasBooked": true
}
}
}
}
},
"default" : {
"description" : "",
"schema" : {
"$ref" : "#/definitions/inline_response_default"
},
"examples" : {
"application/json" : {
"ok" : false,
"error" : "Evento non trovato"
}
}
}
}
}
},
"/event/{id}/book" : {
"post" : {
"tags" : [ "Events" ],
"summary" : "/event/{id}/book",
"description" : "",
"operationId" : "POST_event_book",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "X-Auth-Token",
"in" : "header",
"description" : "",
"required" : true,
"type" : "string"
},
{
"name" : "id",
"in" : "path",
"description" : "",
"required" : true,
"type" : "int"
}, {
"name" : "Content-Type",
"in" : "header",
"description" : "",
"required" : false,
"type" : "string",
"default" : " application/json"
} ],
"responses" : {
"200" : {
"description" : "",
"schema" : {
"$ref" : "#/definitions/inline_response_200"
},
"examples" : {
"application/json" : {
"ok": true,
"data": "success"
}
}
},
"default" : {
"description" : "",
"schema" : {
"$ref" : "#/definitions/inline_response_default"
},
"examples" : {
"application/json" : {
"ok": false,
"error": "Ti sei già prenotato"
}
}
}
}
}
},
"/restaurants" : {
"get" : {
"tags" : [ "Restaurants" ],
"summary" : "/restaurants",
"description" : "",
"operationId" : "GET_restaurants",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "X-Auth-Token",
"in" : "header",
"description" : "",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "",
"schema" : {
"$ref" : "#/definitions/inline_response_200"
},
"examples" : {
"application/json" : {
"ok" : true,
"data": [
{
"restaurant_id": 1,
"name": "Agriturismo Ortanella",
"address": "via Pozzo Vecchio, Esino Lario",
"latitude": 45.98468,
"longitude": 9.3175,
"phone_number": "333 5207056"
},
{
"restaurant_id": 2,
"name": "Albergo Cacciatori",
"address": "via del Roccolo, Esino Lario",
"latitude": 45.98422,
"longitude": 9.31713,
"phone_number": "0341 860219"
}
]
}
}
},
"default" : {
"description" : "",
"schema" : {
"$ref" : "#/definitions/inline_response_default"
},
"examples" : {
"application/json" : {
"ok" : false,
"error" : "Errore generale"
}
}
}
}
}
}
},
"definitions" : {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment