-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.spec.yaml
116 lines (116 loc) · 3.19 KB
/
swagger.spec.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
swagger: "2.0"
info:
description: "This is a simple translation API that offers descriptions for lemma in different languages"
version: "0.0.1"
title: "Alpheios Translation Service"
license:
name: "Mozilla Public License 2.0"
url: "hhttps://www.mozilla.org/en-US/MPL/2.0/"
tags:
- name: "TranslationInterface"
description: "A translation service portal"
schemes:
- "http"
paths:
/{inputLang}:
get:
tags:
- "TranslationInterface"
summary: "List available input languages"
produces:
- "application/json"
parameters:
- name: "inputLang"
in: "path"
description: "Language Code (3 Chars) of the language in which lemma are provided"
required: true
type: "string"
operationId: "getLanguageCapacities"
responses:
200:
description: "successful operation"
schema:
type: "array"
items:
$ref: "#/definitions/TranslationInterface"
404:
description: "Unsupported language"
default:
description: "Error Payload"
schema:
$ref: "#/definitions/ErrorModel"
/{inputLang}/{outputLang}:
get:
tags:
- "TranslationInterface"
summary: "Provides translations mapping"
produces:
- "application/json"
parameters:
- name: "inputLang"
in: "path"
description: "Language Code (3 Chars) of the language in which lemma are provided"
required: true
type: "string"
- name: "outputLang"
in: "path"
description: "Language Code (3 Chars) of the language in which we want translations"
required: true
type: "string"
- name: "input"
in: "query"
description: "Comma separated lemmas that need translations"
required: true
type: "string"
- name: "client"
in: "query"
description: "Name of the lemma provider the client is using (For data improvement)"
required: false
type: "string"
operationId: "getTranslation"
responses:
200:
description: "successful operation"
schema:
type: "array"
items:
$ref: "#/definitions/Translation"
404:
description: "Unsupported language"
400:
description: "Missing input"
default:
description: "Error Payload"
schema:
$ref: "#/definitions/ErrorModel"
definitions:
Translation:
type: "object"
properties:
in:
type: "string"
description: "Input value given by the user"
map:
type: "string"
description: "Input-mapping done by the service"
translations:
type: "array"
description: "List of translations found by the service"
items:
type: "string"
TranslationInterface:
type: "object"
properties:
lang:
type: "string"
uri:
description: "URI of the translation Interface"
type: "string"
ErrorModel:
type: "string"
properties:
message:
type: "string"
externalDocs:
description: "Find out more about Swagger"
url: "http://swagger.io"