-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathopen-api-spec.yaml
executable file
·166 lines (147 loc) · 4.16 KB
/
open-api-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
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
openapi: 3.0.3
info:
version: 0.0.1
title: AzNum2Words API
description: |
REST API for converting number to words in Azerbaijani language
servers:
- url: http://localhost:8080
tags:
- name: Converter
description: API for converting number to words in Azerbaijani language
- name: Health
description: API related to the health of the service
paths:
/api/v1/conversion/to-word:
parameters:
- $ref: '#/components/parameters/x-correlation-id'
post:
summary: Convert number to words in Azerbaijani
description: Convert number to words in Azerbaijani
operationId: convertNumberToWord
tags:
- Converter
requestBody:
$ref: '#/components/requestBodies/ConvertNumberToWordsRequest'
responses:
200:
$ref: '#/components/responses/ConvertNumberToWordsResponse'
default:
$ref: '#/components/responses/UnknownError'
/api/v1/conversion/to-number:
parameters:
- $ref: '#/components/parameters/x-correlation-id'
post:
summary: Convert words in Azerbaijani to number
description: Convert words in Azerbaijani to number
operationId: convertWordsToNumber
tags:
- Converter
requestBody:
$ref: '#/components/requestBodies/ConvertWordsToNumberRequest'
responses:
200:
$ref: '#/components/responses/ConvertWordsToNumberResponse'
default:
$ref: '#/components/responses/UnknownError'
/health:
get:
summary: Check the healthapi of the service
description: Returns a 200 OK response if the service is healthy
tags:
- Health
responses:
200:
description: The service is healthy
components:
schemas:
Error:
type: object
description: Representation of an Error that can appear using the application.
required:
- code
- message
properties:
code:
description: The code of an error that describes the Error.
type: string
message:
description: The message of an error that describes the Error.
type: string
ConvertNumberToWords:
type: object
description: Convert number to words request representation
required:
- number
properties:
number:
description: The number to be converted to words
type: string
ConvertWordsToNumber:
type: object
description: Convert words to number request representation
required:
- words
properties:
words:
description: The words to be converted to number
type: string
Word:
type: object
description: The number representation in words
required:
- words
properties:
words:
description: The number representation in words
type: string
Number:
type: object
description: Words representation in number
required:
- number
properties:
number:
description: Words representation in number
type: string
responses:
UnknownError:
description: The unknown error appeared. Check your payload or contact support.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
ConvertNumberToWordsResponse:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Word'
ConvertWordsToNumberResponse:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Number'
requestBodies:
ConvertNumberToWordsRequest:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ConvertNumberToWords"
ConvertWordsToNumberRequest:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ConvertWordsToNumber"
parameters:
x-correlation-id:
in: header
name: x-correlation-id
required: false
description: >
The unique request identifier
schema:
type: string