apib2swagger 1.16.1 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/.github/workflows/nodejs.yml +1 -1
  2. package/Dockerfile +1 -1
  3. package/README.md +1 -1
  4. package/package.json +1 -1
  5. package/src/requests.js +18 -3
  6. package/test/input/Issue-#72.md +43 -0
  7. package/test/output/01. Simplest API.json +2 -1
  8. package/test/output/01. Simplest API.ref.json +2 -1
  9. package/test/output/02. Resource and Actions.json +6 -2
  10. package/test/output/02. Resource and Actions.ref.json +6 -2
  11. package/test/output/03. Named Resource and Actions.json +6 -2
  12. package/test/output/03. Named Resource and Actions.ref.json +6 -2
  13. package/test/output/04. Grouping Resources.json +6 -2
  14. package/test/output/04. Grouping Resources.ref.json +6 -2
  15. package/test/output/05. Responses.json +6 -2
  16. package/test/output/05. Responses.ref.json +6 -2
  17. package/test/output/06. Requests.json +6 -1
  18. package/test/output/06. Requests.ref.json +6 -1
  19. package/test/output/07. Parameters.json +8 -2
  20. package/test/output/07. Parameters.ref.json +8 -2
  21. package/test/output/08. Attributes.json +2 -1
  22. package/test/output/08. Attributes.ref.json +2 -1
  23. package/test/output/09. Advanced Attributes.json +7 -2
  24. package/test/output/09. Advanced Attributes.ref.json +7 -2
  25. package/test/output/10. Data Structures.json +7 -2
  26. package/test/output/10. Data Structures.ref.json +7 -2
  27. package/test/output/11. Resource Model.json +6 -1
  28. package/test/output/11. Resource Model.ref.json +6 -1
  29. package/test/output/12. Advanced Action.json +6 -3
  30. package/test/output/12. Advanced Action.ref.json +6 -3
  31. package/test/output/13. Named Endpoints.json +6 -0
  32. package/test/output/13. Named Endpoints.ref.json +6 -0
  33. package/test/output/Attributes.json +3 -0
  34. package/test/output/Attributes.ref.json +3 -0
  35. package/test/output/Gist Fox API + Auth.json +25 -7
  36. package/test/output/Gist Fox API + Auth.ref.json +25 -7
  37. package/test/output/Issue-#15.json +6 -3
  38. package/test/output/Issue-#15.ref.json +6 -3
  39. package/test/output/Issue-#23.json +3 -0
  40. package/test/output/Issue-#23.ref.json +3 -0
  41. package/test/output/Issue-#26.json +5 -1
  42. package/test/output/Issue-#26.ref.json +5 -1
  43. package/test/output/Issue-#29.json +5 -1
  44. package/test/output/Issue-#29.ref.json +5 -1
  45. package/test/output/Issue-#33.json +2 -1
  46. package/test/output/Issue-#33.ref.json +2 -1
  47. package/test/output/Issue-#36.json +2 -1
  48. package/test/output/Issue-#36.ref.json +2 -1
  49. package/test/output/Issue-#38.bearer.json +3 -0
  50. package/test/output/Issue-#38.json +3 -0
  51. package/test/output/Issue-#38.ref.json +3 -0
  52. package/test/output/Issue-#49.json +4 -2
  53. package/test/output/Issue-#49.ref.json +4 -2
  54. package/test/output/Issue-#57.json +3 -0
  55. package/test/output/Issue-#57.ref.json +3 -0
  56. package/test/output/Issue-#72.json +170 -0
  57. package/test/output/Issue-#72.ref.json +168 -0
  58. package/test/output/Schema.json +9 -0
  59. package/test/output/Schema.ref.json +9 -0
  60. package/test/output/apiblueprint_uber.json +10 -5
  61. package/test/output/apiblueprint_uber.ref.json +10 -5
  62. package/test/output/apiblueprint_valid_simple.json +25 -7
  63. package/test/output/apiblueprint_valid_simple.ref.json +25 -7
  64. package/test/output/schema_without_body.json +52 -49
  65. package/test/output/schema_without_body.ref.json +52 -49
@@ -0,0 +1,170 @@
1
+ {
2
+ "swagger": "2.0",
3
+ "info": {
4
+ "title": "",
5
+ "version": "",
6
+ "description": ""
7
+ },
8
+ "paths": {
9
+ "/api/scim/v2/Users": {
10
+ "post": {
11
+ "responses": {
12
+ "201": {
13
+ "description": "Created",
14
+ "headers": {},
15
+ "examples": {
16
+ "application/scim+json": {}
17
+ },
18
+ "schema": {
19
+ "type": "object",
20
+ "properties": {}
21
+ }
22
+ }
23
+ },
24
+ "summary": "Create a user",
25
+ "operationId": "Create a user",
26
+ "description": "",
27
+ "tags": [],
28
+ "parameters": [
29
+ {
30
+ "name": "body",
31
+ "in": "body",
32
+ "schema": {
33
+ "type": "object",
34
+ "properties": {
35
+ "schemas": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "string"
39
+ }
40
+ },
41
+ "userName": {
42
+ "type": "string"
43
+ },
44
+ "name": {
45
+ "type": "object",
46
+ "properties": {
47
+ "givenName": {
48
+ "type": "string"
49
+ },
50
+ "familyName": {
51
+ "type": "string"
52
+ }
53
+ }
54
+ },
55
+ "emails": {
56
+ "type": "array",
57
+ "items": {
58
+ "type": "object",
59
+ "properties": {
60
+ "primary": {
61
+ "type": "boolean"
62
+ },
63
+ "value": {
64
+ "type": "string"
65
+ },
66
+ "type": {
67
+ "type": "string"
68
+ }
69
+ }
70
+ }
71
+ },
72
+ "displayName": {
73
+ "type": "string"
74
+ },
75
+ "externalId": {
76
+ "type": "string"
77
+ },
78
+ "active": {
79
+ "type": "boolean"
80
+ }
81
+ },
82
+ "example": {
83
+ "schemas": [
84
+ "urn:ietf:params:scim:schemas:core:2.0:User"
85
+ ],
86
+ "userName": "fredsmith",
87
+ "name": {
88
+ "givenName": "Fred",
89
+ "familyName": "Smith"
90
+ },
91
+ "emails": [
92
+ {
93
+ "primary": true,
94
+ "value": "fred@example.com",
95
+ "type": "work"
96
+ }
97
+ ],
98
+ "displayName": "Fred Smith",
99
+ "externalId": "fred-external-id",
100
+ "active": true
101
+ }
102
+ }
103
+ }
104
+ ],
105
+ "produces": [
106
+ "application/scim+json"
107
+ ],
108
+ "consumes": [
109
+ "application/scim+json"
110
+ ],
111
+ "security": [
112
+ {
113
+ "oauth2": []
114
+ }
115
+ ]
116
+ }
117
+ },
118
+ "/api2/scim/v2/Users": {
119
+ "post": {
120
+ "responses": {
121
+ "201": {
122
+ "description": "Created",
123
+ "headers": {},
124
+ "examples": {
125
+ "application/scim+json": {}
126
+ },
127
+ "schema": {
128
+ "type": "object",
129
+ "properties": {}
130
+ }
131
+ }
132
+ },
133
+ "summary": "Create a user 2",
134
+ "operationId": "Create a user 2",
135
+ "description": "",
136
+ "tags": [],
137
+ "parameters": [],
138
+ "produces": [
139
+ "application/scim+json"
140
+ ],
141
+ "consumes": [
142
+ "application/scim+json"
143
+ ],
144
+ "security": [
145
+ {
146
+ "oauth2": []
147
+ }
148
+ ]
149
+ }
150
+ }
151
+ },
152
+ "definitions": {
153
+ "Create a user": {},
154
+ "Create a user 2": {},
155
+ "ExistingUser": {
156
+ "type": "object",
157
+ "properties": {}
158
+ }
159
+ },
160
+ "securityDefinitions": {
161
+ "oauth2": {
162
+ "type": "oauth2",
163
+ "flow": "accessCode",
164
+ "authorizationUrl": "",
165
+ "tokenUrl": "",
166
+ "scopes": {}
167
+ }
168
+ },
169
+ "tags": []
170
+ }
@@ -0,0 +1,168 @@
1
+ {
2
+ "swagger": "2.0",
3
+ "info": {
4
+ "title": "",
5
+ "version": "",
6
+ "description": ""
7
+ },
8
+ "paths": {
9
+ "/api/scim/v2/Users": {
10
+ "post": {
11
+ "responses": {
12
+ "201": {
13
+ "description": "Created",
14
+ "headers": {},
15
+ "examples": {
16
+ "application/scim+json": {}
17
+ },
18
+ "schema": {
19
+ "$ref": "#/definitions/ExistingUser"
20
+ }
21
+ }
22
+ },
23
+ "summary": "Create a user",
24
+ "operationId": "Create a user",
25
+ "description": "",
26
+ "tags": [],
27
+ "parameters": [
28
+ {
29
+ "name": "body",
30
+ "in": "body",
31
+ "schema": {
32
+ "type": "object",
33
+ "properties": {
34
+ "schemas": {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "string"
38
+ }
39
+ },
40
+ "userName": {
41
+ "type": "string"
42
+ },
43
+ "name": {
44
+ "type": "object",
45
+ "properties": {
46
+ "givenName": {
47
+ "type": "string"
48
+ },
49
+ "familyName": {
50
+ "type": "string"
51
+ }
52
+ }
53
+ },
54
+ "emails": {
55
+ "type": "array",
56
+ "items": {
57
+ "type": "object",
58
+ "properties": {
59
+ "primary": {
60
+ "type": "boolean"
61
+ },
62
+ "value": {
63
+ "type": "string"
64
+ },
65
+ "type": {
66
+ "type": "string"
67
+ }
68
+ }
69
+ }
70
+ },
71
+ "displayName": {
72
+ "type": "string"
73
+ },
74
+ "externalId": {
75
+ "type": "string"
76
+ },
77
+ "active": {
78
+ "type": "boolean"
79
+ }
80
+ },
81
+ "example": {
82
+ "schemas": [
83
+ "urn:ietf:params:scim:schemas:core:2.0:User"
84
+ ],
85
+ "userName": "fredsmith",
86
+ "name": {
87
+ "givenName": "Fred",
88
+ "familyName": "Smith"
89
+ },
90
+ "emails": [
91
+ {
92
+ "primary": true,
93
+ "value": "fred@example.com",
94
+ "type": "work"
95
+ }
96
+ ],
97
+ "displayName": "Fred Smith",
98
+ "externalId": "fred-external-id",
99
+ "active": true
100
+ }
101
+ }
102
+ }
103
+ ],
104
+ "produces": [
105
+ "application/scim+json"
106
+ ],
107
+ "consumes": [
108
+ "application/scim+json"
109
+ ],
110
+ "security": [
111
+ {
112
+ "oauth2": []
113
+ }
114
+ ]
115
+ }
116
+ },
117
+ "/api2/scim/v2/Users": {
118
+ "post": {
119
+ "responses": {
120
+ "201": {
121
+ "description": "Created",
122
+ "headers": {},
123
+ "examples": {
124
+ "application/scim+json": {}
125
+ },
126
+ "schema": {
127
+ "$ref": "#/definitions/ExistingUser"
128
+ }
129
+ }
130
+ },
131
+ "summary": "Create a user 2",
132
+ "operationId": "Create a user 2",
133
+ "description": "",
134
+ "tags": [],
135
+ "parameters": [],
136
+ "produces": [
137
+ "application/scim+json"
138
+ ],
139
+ "consumes": [
140
+ "application/scim+json"
141
+ ],
142
+ "security": [
143
+ {
144
+ "oauth2": []
145
+ }
146
+ ]
147
+ }
148
+ }
149
+ },
150
+ "definitions": {
151
+ "Create a user": {},
152
+ "Create a user 2": {},
153
+ "ExistingUser": {
154
+ "type": "object",
155
+ "properties": {}
156
+ }
157
+ },
158
+ "securityDefinitions": {
159
+ "oauth2": {
160
+ "type": "oauth2",
161
+ "flow": "accessCode",
162
+ "authorizationUrl": "",
163
+ "tokenUrl": "",
164
+ "scopes": {}
165
+ }
166
+ },
167
+ "tags": []
168
+ }
@@ -46,6 +46,9 @@
46
46
  }
47
47
  }
48
48
  }
49
+ ],
50
+ "consumes": [
51
+ "application/json"
49
52
  ]
50
53
  }
51
54
  },
@@ -86,6 +89,9 @@
86
89
  }
87
90
  }
88
91
  }
92
+ ],
93
+ "consumes": [
94
+ "application/json"
89
95
  ]
90
96
  }
91
97
  },
@@ -173,6 +179,9 @@
173
179
  ],
174
180
  "produces": [
175
181
  "application/json"
182
+ ],
183
+ "consumes": [
184
+ "application/json"
176
185
  ]
177
186
  }
178
187
  }
@@ -46,6 +46,9 @@
46
46
  }
47
47
  }
48
48
  }
49
+ ],
50
+ "consumes": [
51
+ "application/json"
49
52
  ]
50
53
  }
51
54
  },
@@ -81,6 +84,9 @@
81
84
  }
82
85
  }
83
86
  }
87
+ ],
88
+ "consumes": [
89
+ "application/json"
84
90
  ]
85
91
  }
86
92
  },
@@ -168,6 +174,9 @@
168
174
  ],
169
175
  "produces": [
170
176
  "application/json"
177
+ ],
178
+ "consumes": [
179
+ "application/json"
171
180
  ]
172
181
  }
173
182
  }
@@ -68,7 +68,8 @@
68
68
  "type": "string"
69
69
  }
70
70
  }
71
- ]
71
+ ],
72
+ "consumes": []
72
73
  }
73
74
  },
74
75
  "/v1/estimates/price": {
@@ -159,7 +160,8 @@
159
160
  "type": "string"
160
161
  }
161
162
  }
162
- ]
163
+ ],
164
+ "consumes": []
163
165
  }
164
166
  },
165
167
  "/v1/estimates/time": {
@@ -242,7 +244,8 @@
242
244
  "type": "string"
243
245
  }
244
246
  }
245
- ]
247
+ ],
248
+ "consumes": []
246
249
  }
247
250
  },
248
251
  "/v1/me": {
@@ -285,7 +288,8 @@
285
288
  "tags": [
286
289
  "User"
287
290
  ],
288
- "parameters": []
291
+ "parameters": [],
292
+ "consumes": []
289
293
  }
290
294
  },
291
295
  "/v1/history": {
@@ -354,7 +358,8 @@
354
358
  "type": "string"
355
359
  }
356
360
  }
357
- ]
361
+ ],
362
+ "consumes": []
358
363
  }
359
364
  }
360
365
  },
@@ -68,7 +68,8 @@
68
68
  "type": "string"
69
69
  }
70
70
  }
71
- ]
71
+ ],
72
+ "consumes": []
72
73
  }
73
74
  },
74
75
  "/v1/estimates/price": {
@@ -159,7 +160,8 @@
159
160
  "type": "string"
160
161
  }
161
162
  }
162
- ]
163
+ ],
164
+ "consumes": []
163
165
  }
164
166
  },
165
167
  "/v1/estimates/time": {
@@ -242,7 +244,8 @@
242
244
  "type": "string"
243
245
  }
244
246
  }
245
- ]
247
+ ],
248
+ "consumes": []
246
249
  }
247
250
  },
248
251
  "/v1/me": {
@@ -285,7 +288,8 @@
285
288
  "tags": [
286
289
  "User"
287
290
  ],
288
- "parameters": []
291
+ "parameters": [],
292
+ "consumes": []
289
293
  }
290
294
  },
291
295
  "/v1/history": {
@@ -354,7 +358,8 @@
354
358
  "type": "string"
355
359
  }
356
360
  }
357
- ]
361
+ ],
362
+ "consumes": []
358
363
  }
359
364
  }
360
365
  },
@@ -92,7 +92,8 @@
92
92
  "parameters": [],
93
93
  "produces": [
94
94
  "application/hal+json"
95
- ]
95
+ ],
96
+ "consumes": []
96
97
  }
97
98
  },
98
99
  "/gists/{id}": {
@@ -132,7 +133,8 @@
132
133
  "required": false,
133
134
  "type": "string"
134
135
  }
135
- ]
136
+ ],
137
+ "consumes": []
136
138
  },
137
139
  "patch": {
138
140
  "responses": {
@@ -185,6 +187,9 @@
185
187
  }
186
188
  }
187
189
  }
190
+ ],
191
+ "consumes": [
192
+ "application/json"
188
193
  ]
189
194
  },
190
195
  "delete": {
@@ -216,7 +221,8 @@
216
221
  "required": false,
217
222
  "type": "string"
218
223
  }
219
- ]
224
+ ],
225
+ "consumes": []
220
226
  }
221
227
  },
222
228
  "/gists": {
@@ -275,7 +281,8 @@
275
281
  ],
276
282
  "produces": [
277
283
  "application/hal+json"
278
- ]
284
+ ],
285
+ "consumes": []
279
286
  },
280
287
  "post": {
281
288
  "responses": {
@@ -325,6 +332,9 @@
325
332
  }
326
333
  }
327
334
  }
335
+ ],
336
+ "consumes": [
337
+ "application/json"
328
338
  ]
329
339
  }
330
340
  },
@@ -358,7 +368,8 @@
358
368
  "required": false,
359
369
  "type": "string"
360
370
  }
361
- ]
371
+ ],
372
+ "consumes": []
362
373
  },
363
374
  "delete": {
364
375
  "responses": {
@@ -389,7 +400,8 @@
389
400
  "required": false,
390
401
  "type": "string"
391
402
  }
392
- ]
403
+ ],
404
+ "consumes": []
393
405
  },
394
406
  "get": {
395
407
  "responses": {
@@ -427,7 +439,8 @@
427
439
  "required": false,
428
440
  "type": "string"
429
441
  }
430
- ]
442
+ ],
443
+ "consumes": []
431
444
  }
432
445
  },
433
446
  "/authorization": {
@@ -453,6 +466,7 @@
453
466
  "Access Authorization and Control"
454
467
  ],
455
468
  "parameters": [],
469
+ "consumes": [],
456
470
  "security": [
457
471
  {
458
472
  "basic": []
@@ -495,6 +509,9 @@
495
509
  }
496
510
  }
497
511
  ],
512
+ "consumes": [
513
+ "application/json"
514
+ ],
498
515
  "security": [
499
516
  {
500
517
  "basic": []
@@ -516,6 +533,7 @@
516
533
  "Access Authorization and Control"
517
534
  ],
518
535
  "parameters": [],
536
+ "consumes": [],
519
537
  "security": [
520
538
  {
521
539
  "basic": []