duck-booking-tool/swagger/swagger.yaml

92 lines
2.5 KiB
YAML
Raw Permalink Normal View History

---
swagger: "2.0"
info:
2016-10-28 01:26:19 +00:00
version: "0.1.0"
title: "Rubber Duck Booking Tool API"
basePath: "/api/v1"
consumes:
2016-10-28 01:25:48 +00:00
- "application/json"
produces:
2016-10-28 01:25:48 +00:00
- "application/json"
paths:
2016-10-28 01:25:48 +00:00
/ducks:
get:
tags:
2016-10-28 01:25:48 +00:00
- "default_controller"
description: "Get the list of all ducks"
operationId: "controllers.default_controller.ducks_get"
parameters: []
responses:
200:
description: "An object which contains metadata and an array of ducks"
2016-10-27 19:28:03 +00:00
schema:
2016-10-28 09:51:36 +00:00
type: "array"
2016-10-27 19:28:03 +00:00
items:
2016-10-28 01:25:48 +00:00
$ref: '#/definitions/Duck'
security:
2016-10-28 01:25:48 +00:00
- api_key: []
2016-10-28 01:26:19 +00:00
/duck:
get:
tags:
- "default_controller"
2016-10-28 01:55:36 +00:00
operationId: "controllers.default_controller.duck_get"
2016-10-28 09:51:36 +00:00
parameters:
- name: "duck_id"
description: "ID of the Duck"
in: "path"
required: true
type: "integer"
2016-10-28 01:26:19 +00:00
responses:
200:
description: "All data regarding the specified duck"
2016-10-28 09:51:36 +00:00
post:
tags:
- "default_controller"
operationId: "controllers.default_controller.duck_post"
parameters:
- name: "name"
description: "Name of the Duck"
in: "formData"
required: true
type: "string"
- name: "color"
description: "Color of the Duck"
in: "formData"
required: true
type: "string"
responses:
200:
description: "Cool"
securityDefinitions:
api_key:
type: "apiKey"
name: "token"
in: "header"
2016-10-27 19:28:03 +00:00
definitions:
Duck:
2016-10-28 09:51:36 +00:00
type: "object"
2016-10-27 19:28:03 +00:00
properties:
2016-10-28 01:26:19 +00:00
duck_id:
2016-10-28 09:51:36 +00:00
type: "integer"
description: "ID number of the duck"
2016-10-27 19:28:03 +00:00
name:
2016-10-28 09:51:36 +00:00
type: "string"
description: "The name of the duck"
2016-10-28 01:26:19 +00:00
color:
2016-10-28 09:51:36 +00:00
type: "string"
description: "Color of the duck"
2016-10-28 01:26:19 +00:00
#species = models.ForeignKey(Species)
#location = models.ForeignKey(Location)
#competencies:
# type: array
# items: strings
# description: A list of competencies the duck has
#donated_by = models.ForeignKey(User)
#donated_at = models.DateTimeField(default=timezone.now)
#adopted_by = models.ForeignKey(User, related_name='adopted_ducks', null=True, blank=True)
#adopted_at = models.DateTimeField(null=True, blank=True)
#bookings = models.ManyToManyField(User, through='Booking', related_name='+')
#on_holiday_since = models.DateTimeField(null=True, blank=True)
#on_holiday_until = models.DateTimeField(null=True, blank=True)