redo input swagger definition

This commit is contained in:
Torma Kristóf 2020-03-27 23:31:23 +01:00
parent 34f0706361
commit 39d58ff2a9
1 changed files with 68 additions and 75 deletions

143
input.yml
View File

@ -1,81 +1,74 @@
openapi: 3.0.0
swagger: "2.0"
info:
title: Input endpoint of system
version: 1.0.1
servers:
- url: https://dev.k8s.tcloud.enginner/api/input/v1
description: "This s the input interface of the Birbnetes system."
version: "1.0.10"
title: "Input Service"
contact:
email: "tormakristof@tormakristof.eu"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "dev.k8s.tcloud.enginner"
basePath: "/api/input/v1"
tags:
- name: "input"
description: "Input Service interaction"
schemes:
- "https"
- "http"
paths:
/sample:
post:
summary: Upload sound file into the system
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
description:
type: object
properties:
date:
type: string
format: date
device_id:
type: string
soundFile:
type: string
format: binary
tags:
- "input"
summary: "uploads a sample into the system"
description: ""
operationId: "uploadFile"
consumes:
- "multipart/form-data"
produces:
- "application/json"
parameters:
- name: "date"
in: "formData"
description: "Date of recording"
required: true
type: "string"
format: "date"
- name: "device_id"
in: "formData"
description: "ID of recording device"
required: true
type: "integer"
format: "int64"
- name: "file"
in: "formData"
description: "Wave file to upload"
required: true
type: "file"
responses:
'200':
description: OK Message
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/OK'
'416':
description: Media type error
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Error'
'400':
description: JSON parse error
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Error'
'444':
description: JSON invalid schema
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Error'
200:
description: "successful operation"
schema:
$ref: "#/definitions/ApiResponse"
416:
description: "Media type error"
schema:
$ref: "#/definitions/ApiResponse"
400:
description: "JSON parse error"
schema:
$ref: "#/definitions/ApiResponse"
444:
description: "JSON invalid schema"
schema:
$ref: "#/definitions/ApiResponse"
components:
schemas:
OK:
properties:
status:
type: string
description: "Status message from backend."
required:
- status
Error:
properties:
status:
type: string
description: "Status message from backend."
message:
type: string
description: "Error message"
required:
- status
- message
definitions:
ApiResponse:
type: "object"
properties:
status:
type: "string"
message:
type: "string"