diff --git a/backend/openapi.yml b/backend/openapi.yml new file mode 100644 index 0000000000000000000000000000000000000000..69fdb1887aaf8a3ba0b7821f7cba66a19ab68909 --- /dev/null +++ b/backend/openapi.yml @@ -0,0 +1,149 @@ +swagger: "2.0" +info: + version: "0.0.0" + title: "DVC 2021 Backend API" + contact: + email: "rasmus.thomsen@student.fh-kiel.de" +host: "localhost:8000" +schemes: + - "http" +paths: + /ribbons: + get: + summary: "Get all Ribbons." + produces: + - "application/json" + parameters: + - in: path + name: from + required: false + description: Minimum ribbon number to return. Must be lower than to. + - in: path + name: to + required: false + description: Maximum ribbon number to return. Must be higher than from. + responses: + "200": + description: "successful operation" + schema: + type: array + items: + $ref: "#/definitions/Ribbon" + "400": + description: "Invalid request" + /ribbons/{municipality}: + get: + summary: "Get a certain Ribbon." + produces: + - "application/json" + parameters: + - in: path + name: municipality + type: integer + required: true + description: Numeric ID of the municipality whose ribbon should be returned. + responses: + "200": + description: "successful operation" + schema: + type: array + items: + $ref: "#/definitions/Ribbon" + "400": + description: "Invalid request" + /ribbons/categories/{municipality}: + get: + summary: "Get what categories a certain ribbon belongs to." + produces: + - "application/json" + parameters: + - in: path + name: municipality + type: integer + required: true + description: Numeric ID of the municipality whose ribbon's categories should be returned. + responses: + "200": + description: "successful operation" + schema: + type: array + items: + $ref: "#/definitions/Category" + "400": + description: "Invalid request" + /ribbons/compare/{municipality}: + post: + summary: "Compare an uploaded image to the ribbon of a certain municipality." + consumes: + - "image/jpeg" + produces: + - "application/json" + parameters: + - in: path + name: municipality + type: integer + required: true + description: Numeric ID of the municipality whose ribbon should be compared to. + - in: formData + name: image + required: true + type: binary + description: The picture to compare to. + responses: + "200": + description: "successful operation" + schema: + type: array + items: + $ref: "#/definitions/Category" + "400": + description: "Invalid request" +definitions: + Ribbon: + type: "object" + properties: + acceptance: + type: "string" + format: "string" + author: + type: "string" + format: "string" + cancellation: + type: "string" + format: "string" + cancellationReason: + type: "string" + format: "string" + description: + type: "string" + format: "string" + figure: + type: "string" + format: "string" + historicalJustification: + type: "string" + format: "string" + img: + type: "string" + format: "string" + municipalityName: + type: "string" + format: "string" + municipality: + type: "array" + format: "array" + items: + type: "string" + format: "string" + Category: + type: "object" + properties: + name: + type: "string" + format: "string" + hitrate: + type: "number" + format: "number" +externalDocs: + description: "Find out more about Swagger" + url: "http://swagger.io"