-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathopenapi.yaml
178 lines (178 loc) · 4.71 KB
/
openapi.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
openapi: 3.0.1
info:
title: Rosetta Translate Widget Back-end API
description: This defines the format and usage that the translate widget is expecting.
version: 1.0.0
externalDocs:
description: GitHub repo
url: https://github.com/au5ton/rosetta
servers:
- url: https://YOUR_SERVER_HERE.com/
- url: https://rosetta-demo-server.vercel.app/api/legacy
description: Data is sourced from [@vitalets/google-translate-api](https://github.com/vitalets/google-translate-api)
- url: https://rosetta-demo-server.vercel.app/api/v2
description: Data is sourced from [Google Cloud Translation API (Basic)](https://cloud.google.com/translate/docs/reference/libraries/v2/overview-v2)
- url: https://rosetta-demo-server.vercel.app/api/v3
description: Data is sourced from [Google Cloud Translation API (Advanced)](https://cloud.google.com/translate/docs/reference/libraries/v3/overview-v3)
- url: https://rosetta-demo-server.vercel.app/api/msft
description: Data is sourced from [Microsoft Translator API](https://docs.microsoft.com/en-us/azure/cognitive-services/translator/)
paths:
/translate:
post:
summary: Translate some text
operationId: translate
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Translate'
required: true
responses:
405:
description: Invalid input
content: {}
x-codegen-request-body-name: body
/supportedLanguages:
get:
summary: Gets the list of supported languages for translation
description: ''
operationId: supportedLanguages
parameters:
- name: target
in: query
description: The native language in which to present the supported languages
required: false
schema:
type: string
default: 'en'
- name: siteName
in: query
description: An optional identifier for the site being translated
required: false
schema:
type: string
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SupportedLanguage'
400:
description: Invalid status value
content: {}
/updateTranslation:
post:
operationId: updateTranslation
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/updateTranslation'
required: true
responses:
'200':
content:
application/json:
schema: {}
description: Successful Response
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
description: Validation Error
summary: Update Translation
components:
schemas:
Translate:
properties:
from:
title: From
type: string
to:
title: To
type: string
siteName:
default: ''
title: Sitename
type: string
text:
items:
type: string
title: Text
type: array
page_url:
title: Page Url
type: string
required:
- from
- to
- text
type: object
SupportedLanguage:
type: object
properties:
languageCode:
type: string
displayName:
type: string
updateTranslation:
properties:
from:
title: From
type: string
to:
title: To
type: string
siteName:
default: ''
title: Sitename
type: string
originalText:
title: Originaltext
type: string
text:
title: Text
type: string
page_url:
title: Page Url
type: string
required:
- from
- to
- originalText
- text
type: object
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
title: Detail
type: array
title: HTTPValidationError
type: object
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
title: Location
type: array
msg:
title: Message
type: string
type:
title: Error Type
type: string
required:
- loc
- msg
- type
title: ValidationError
type: object