From 5c7ca46e5655461aaadc20f785a879a496930b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Barna?= Date: Fri, 28 Oct 2016 11:51:36 +0200 Subject: [PATCH] Add get/post parameters to /duck --- swagger/swagger.yaml | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 83e8421..5129428 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -20,7 +20,7 @@ paths: 200: description: "An object which contains metadata and an array of ducks" schema: - type: array + type: "array" items: $ref: '#/definitions/Duck' security: @@ -30,9 +30,33 @@ paths: tags: - "default_controller" operationId: "controllers.default_controller.duck_get" + parameters: + - name: "duck_id" + description: "ID of the Duck" + in: "path" + required: true + type: "integer" responses: 200: description: "All data regarding the specified duck" + 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" @@ -40,17 +64,17 @@ securityDefinitions: in: "header" definitions: Duck: - type: object + type: "object" properties: duck_id: - type: number - description: ID number of the duck + type: "integer" + description: "ID number of the duck" name: - type: string - description: The name of the duck + type: "string" + description: "The name of the duck" color: - type: string - description: Color of the duck + type: "string" + description: "Color of the duck" #species = models.ForeignKey(Species) #location = models.ForeignKey(Location) #competencies: