-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathswagger.yaml
280 lines (280 loc) · 10.2 KB
/
swagger.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
swagger: '2.0'
info:
description: '<p> This service is meant to provide automation for checking requirements conformance to boilerplates/templates. A boilerplate or template contains the syntactic structure of a requirement statement.</p><p> There are two types of operations (each method has a more extensive description in its own operation box):</p><ul><li> Main methods <ul><li><i>InTemplates</i>: Adds templates to the service''s database and assigns them to the specified organization. The templates must be written following a defined format explained later in this section.</li><li><i>OutTemplates</i>: Returns the templates of the specified organization.</li><li><i>Conformance</i>: Checks if the input requirements follow at least one of the templates of the specified organization.</li></ul></li><li> Auxiliary methods<ul><li><i>DeleteOrganizationTemplates</i>: Deletes the templates of the specified organization.</li><li><i>ClearDatabase</i>: Deletes all the templates from the database.</li></ul></li></ul> <p> A template follows a modified BNF diagram:</p> <ul> <li>A template is defined by one or more rules (the rules are defined by an array of strings).</li> <li>The first word of each rule must be written as " <name_of_the_rule> ::= " that defines the name of the rule.</li> <li>The name of the first rule must be <i>main</i>.</li> <li>The first rule must define the structure of the requirement.</li> <li>The other rules should be used to define auxiliary structures.</li> <li> The permitted tags are: <ul> <li> plain words (specified with "%"). </li> <li> pos tags of the <a href="http://dpdearing.com/posts/2011/12/opennlp-part-of-speech-pos-tags-penn-english-treebank/">OpenNLP</a> library (specified with "()"). </li> <li> sentence tags -<i>NP</i> or <i>VP</i>- (specified with "<>"). </li> <li> component special tags: <ul> <li> <i>|</i> : OR </li> <li> <i>(all)</i> : ignores the rule</li> <li> <i><*></i> : accepts anything that comes after </li></ul></li></ul></li></ul><p> An example of the needed template structure of the service is as follows. The example contains the Rupp''s template: </p> <ul> <li> <main> ::= <opt-condition> <np> (md) (vb) <np> | <opt-condition> <np> <modal> %PROVIDE <np> %WITH %THE %ABILITY <infinitive-vp> <np> | <opt-condition> <np> <modal> %BE %ABLE <vp> <np> </li><li> <conditional-keyword> ::= %IF | %AFTER | %AS %SOON %AS | %AS %LONG %AS </li><li> <modal> ::= %SHALL | %SHOULD | %WOULD </li><li> <opt-condition> ::= <conditional-keyword> | (all) </li><li> <infinitive-vp> ::= %to <vp> </li> </ul><p> The API uses UTF-8 charset. Also, it uses the OpenReq format for input JSONs. </p>'
version: '1.0'
title: Requirements Conformance to Templates
license:
name: License
url: 'https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt'
host: api.openreq.eu
basePath: /conformance-to-templates
tags:
- name: rest-api-controller
description: Rest Api Controller
schemes:
- https
paths:
/upc/reqquality/check-conformance-to-templates/ClearDatabase:
delete:
tags:
- Auxiliary methods
summary: Delete all data from the database
description: 'Deletes all data from the database. If this method is called while a calculation is being carried out, unforeseen results may occur.'
operationId: clearTemplatesUsingDELETE
produces:
- '*/*'
responses:
'200':
description: OK
schema:
$ref: '#/definitions/ResponseEntity'
'500':
description: Internal error
deprecated: false
/upc/reqquality/check-conformance-to-templates/Conformance:
post:
tags:
- Main methods
summary: Check whether requirements are conformant to templates
description: <p>Checks if the input requirements follow at least one of the templates of the specified organization. The method returns the requirements that do not conform to any template and for each one a set of tips to correct the structure of the requirement to fit the organization's templates.</p>
operationId: checkConformanceUsingPOST
consumes:
- application/json
produces:
- '*/*'
parameters:
- in: body
name: json
description: A OpenReq JSON with requirements
required: true
schema:
$ref: '#/definitions/Requirements'
- name: organization
in: query
description: The name of the organization
required: true
type: string
allowEmptyValue: false
x-example: UPC
responses:
'200':
description: OK
schema:
$ref: '#/definitions/ResponseEntity'
'400':
description: 'Bad request: An input requirement has no id'
'404':
description: 'Not found: The organization has no templates in the database'
'500':
description: Internal error
deprecated: false
/upc/reqquality/check-conformance-to-templates/DeleteOrganizationTemplates:
delete:
tags:
- Auxiliary methods
summary: Delete all templates of an organization
description: Deletes all the templates of the specified organization.
operationId: clearTemplatesUsingDELETE_1
produces:
- '*/*'
parameters:
- name: organization
in: query
description: The name of the organization
required: true
type: string
allowEmptyValue: false
x-example: UPC
responses:
'200':
description: OK
schema:
$ref: '#/definitions/ResponseEntity'
'404':
description: 'Not found: The organization has no templates in the database'
'500':
description: Internal error
deprecated: false
/upc/reqquality/check-conformance-to-templates/InTemplates:
post:
tags:
- Main methods
summary: Adds templates to an organization
description: <p>Adds the input templates to the service's database and assigns them to the specified organizations. The templates must be written following a defined format explained in the top description.</p>
operationId: enterNewTemplatesUsingPOST
consumes:
- application/json
produces:
- '*/*'
parameters:
- in: body
name: json
description: json
required: true
schema:
$ref: '#/definitions/Templates'
responses:
'200':
description: OK
schema:
$ref: '#/definitions/ResponseEntity'
'400':
description: Bad BNF syntax
'500':
description: Internal error
deprecated: false
/upc/reqquality/check-conformance-to-templates/OutTemplates:
get:
tags:
- Main methods
summary: Returns the templates of an organization
description: 'Returns an array with the names of the templates saved in the database of the specified organization. '
operationId: checkTemplatesUsingGET
produces:
- '*/*'
parameters:
- name: organization
in: query
description: 'The name of the organization. '
required: true
type: string
allowEmptyValue: false
x-example: UPC
responses:
'200':
description: OK
schema:
$ref: '#/definitions/ResponseEntity'
'404':
description: 'Not found: The organization has no templates in the database'
'500':
description: Internal error
deprecated: false
definitions:
Requirement:
type: object
properties:
description:
type: string
example: The Surveillance and Tracking module shall provide the system administrator with the ability to monitor system configuration changes posted to the database.
description: description
id:
type: string
example: UPC-1
description: id
title: Requirement
description: A requirement with id and text
Requirements:
type: object
properties:
requirements:
type: array
items:
$ref: '#/definitions/Requirement'
title: Requirements
description: A list of requirements with id and text
ResponseEntity:
type: object
properties:
body:
type: object
statusCode:
type: string
enum:
- '100'
- '101'
- '102'
- '103'
- '200'
- '201'
- '202'
- '203'
- '204'
- '205'
- '206'
- '207'
- '208'
- '226'
- '300'
- '301'
- '302'
- '303'
- '304'
- '305'
- '307'
- '308'
- '400'
- '401'
- '402'
- '403'
- '404'
- '405'
- '406'
- '407'
- '408'
- '409'
- '410'
- '411'
- '412'
- '413'
- '414'
- '415'
- '416'
- '417'
- '418'
- '419'
- '420'
- '421'
- '422'
- '423'
- '424'
- '426'
- '428'
- '429'
- '431'
- '451'
- '500'
- '501'
- '502'
- '503'
- '504'
- '505'
- '506'
- '507'
- '508'
- '509'
- '510'
- '511'
statusCodeValue:
type: integer
format: int32
title: ResponseEntity
Template:
type: object
properties:
name:
type: string
example: Rupp
description: name
organization:
type: string
example: UPC
description: organization
rules:
type: array
example:
- '<main> ::= <np> %to (vb) <*>'
description: rules
items:
type: string
title: Template
description: A template to be checked against requirements
Templates:
type: object
properties:
templates:
type: array
items:
$ref: '#/definitions/Template'
title: Templates
description: A list of templates