apib2swagger 1.15.0 → 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 (73) hide show
  1. package/.github/workflows/nodejs.yml +1 -1
  2. package/.travis.yml +1 -1
  3. package/Dockerfile +1 -1
  4. package/README.md +1 -1
  5. package/package.json +1 -1
  6. package/src/mson_to_json_schema.js +1 -0
  7. package/src/requests.js +18 -3
  8. package/src/responses.js +7 -1
  9. package/test/input/Issue-#35.md +6 -0
  10. package/test/input/Issue-#72.md +43 -0
  11. package/test/output/01. Simplest API.json +2 -1
  12. package/test/output/01. Simplest API.ref.json +2 -1
  13. package/test/output/02. Resource and Actions.json +6 -2
  14. package/test/output/02. Resource and Actions.ref.json +6 -2
  15. package/test/output/03. Named Resource and Actions.json +6 -2
  16. package/test/output/03. Named Resource and Actions.ref.json +6 -2
  17. package/test/output/04. Grouping Resources.json +6 -2
  18. package/test/output/04. Grouping Resources.ref.json +6 -2
  19. package/test/output/05. Responses.json +17 -2
  20. package/test/output/05. Responses.ref.json +17 -2
  21. package/test/output/06. Requests.json +17 -1
  22. package/test/output/06. Requests.ref.json +17 -1
  23. package/test/output/07. Parameters.json +55 -2
  24. package/test/output/07. Parameters.ref.json +55 -2
  25. package/test/output/08. Attributes.json +2 -1
  26. package/test/output/08. Attributes.ref.json +2 -1
  27. package/test/output/09. Advanced Attributes.json +7 -2
  28. package/test/output/09. Advanced Attributes.ref.json +7 -2
  29. package/test/output/10. Data Structures.json +7 -2
  30. package/test/output/10. Data Structures.ref.json +7 -2
  31. package/test/output/11. Resource Model.json +6 -1
  32. package/test/output/11. Resource Model.ref.json +6 -1
  33. package/test/output/12. Advanced Action.json +69 -3
  34. package/test/output/12. Advanced Action.ref.json +69 -3
  35. package/test/output/13. Named Endpoints.json +6 -0
  36. package/test/output/13. Named Endpoints.ref.json +6 -0
  37. package/test/output/Attributes.json +3 -0
  38. package/test/output/Attributes.ref.json +3 -0
  39. package/test/output/Gist Fox API + Auth.json +76 -7
  40. package/test/output/Gist Fox API + Auth.ref.json +76 -7
  41. package/test/output/Issue-#15.json +6 -3
  42. package/test/output/Issue-#15.ref.json +6 -3
  43. package/test/output/Issue-#23.json +3 -0
  44. package/test/output/Issue-#23.ref.json +3 -0
  45. package/test/output/Issue-#26.json +5 -1
  46. package/test/output/Issue-#26.ref.json +5 -1
  47. package/test/output/Issue-#29.json +5 -1
  48. package/test/output/Issue-#29.ref.json +5 -1
  49. package/test/output/Issue-#33.json +2 -1
  50. package/test/output/Issue-#33.ref.json +2 -1
  51. package/test/output/Issue-#35.json +9 -0
  52. package/test/output/Issue-#35.ref.json +9 -0
  53. package/test/output/Issue-#36.json +2 -1
  54. package/test/output/Issue-#36.ref.json +2 -1
  55. package/test/output/Issue-#38.bearer.json +3 -0
  56. package/test/output/Issue-#38.json +3 -0
  57. package/test/output/Issue-#38.ref.json +3 -0
  58. package/test/output/Issue-#49.json +4 -2
  59. package/test/output/Issue-#49.ref.json +4 -2
  60. package/test/output/Issue-#57.json +3 -0
  61. package/test/output/Issue-#57.ref.json +3 -0
  62. package/test/output/Issue-#72.json +170 -0
  63. package/test/output/Issue-#72.ref.json +168 -0
  64. package/test/output/OpenAPI3_responses.json +240 -232
  65. package/test/output/OpenAPI3_responses.ref.json +231 -223
  66. package/test/output/Schema.json +20 -0
  67. package/test/output/Schema.ref.json +20 -0
  68. package/test/output/apiblueprint_uber.json +10 -5
  69. package/test/output/apiblueprint_uber.ref.json +10 -5
  70. package/test/output/apiblueprint_valid_simple.json +76 -7
  71. package/test/output/apiblueprint_valid_simple.ref.json +76 -7
  72. package/test/output/schema_without_body.json +52 -49
  73. package/test/output/schema_without_body.ref.json +52 -49
@@ -31,6 +31,57 @@
31
31
  }
32
32
  }
33
33
  }
34
+ },
35
+ "schema": {
36
+ "type": "object",
37
+ "properties": {
38
+ "_links": {
39
+ "type": "object",
40
+ "properties": {
41
+ "self": {
42
+ "type": "object",
43
+ "properties": {
44
+ "href": {
45
+ "type": "string"
46
+ }
47
+ }
48
+ },
49
+ "gists": {
50
+ "type": "object",
51
+ "properties": {
52
+ "href": {
53
+ "type": "string"
54
+ },
55
+ "templated": {
56
+ "type": "boolean"
57
+ }
58
+ }
59
+ },
60
+ "authorization": {
61
+ "type": "object",
62
+ "properties": {
63
+ "href": {
64
+ "type": "string"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ },
71
+ "example": {
72
+ "_links": {
73
+ "self": {
74
+ "href": "/"
75
+ },
76
+ "gists": {
77
+ "href": "/gists?{since}",
78
+ "templated": true
79
+ },
80
+ "authorization": {
81
+ "href": "/authorization"
82
+ }
83
+ }
84
+ }
34
85
  }
35
86
  }
36
87
  },
@@ -41,7 +92,8 @@
41
92
  "parameters": [],
42
93
  "produces": [
43
94
  "application/hal+json"
44
- ]
95
+ ],
96
+ "consumes": []
45
97
  }
46
98
  },
47
99
  "/gists/{id}": {
@@ -81,7 +133,8 @@
81
133
  "required": false,
82
134
  "type": "string"
83
135
  }
84
- ]
136
+ ],
137
+ "consumes": []
85
138
  },
86
139
  "patch": {
87
140
  "responses": {
@@ -134,6 +187,9 @@
134
187
  }
135
188
  }
136
189
  }
190
+ ],
191
+ "consumes": [
192
+ "application/json"
137
193
  ]
138
194
  },
139
195
  "delete": {
@@ -165,7 +221,8 @@
165
221
  "required": false,
166
222
  "type": "string"
167
223
  }
168
- ]
224
+ ],
225
+ "consumes": []
169
226
  }
170
227
  },
171
228
  "/gists": {
@@ -224,7 +281,8 @@
224
281
  ],
225
282
  "produces": [
226
283
  "application/hal+json"
227
- ]
284
+ ],
285
+ "consumes": []
228
286
  },
229
287
  "post": {
230
288
  "responses": {
@@ -274,6 +332,9 @@
274
332
  }
275
333
  }
276
334
  }
335
+ ],
336
+ "consumes": [
337
+ "application/json"
277
338
  ]
278
339
  }
279
340
  },
@@ -307,7 +368,8 @@
307
368
  "required": false,
308
369
  "type": "string"
309
370
  }
310
- ]
371
+ ],
372
+ "consumes": []
311
373
  },
312
374
  "delete": {
313
375
  "responses": {
@@ -338,7 +400,8 @@
338
400
  "required": false,
339
401
  "type": "string"
340
402
  }
341
- ]
403
+ ],
404
+ "consumes": []
342
405
  },
343
406
  "get": {
344
407
  "responses": {
@@ -376,7 +439,8 @@
376
439
  "required": false,
377
440
  "type": "string"
378
441
  }
379
- ]
442
+ ],
443
+ "consumes": []
380
444
  }
381
445
  },
382
446
  "/authorization": {
@@ -402,6 +466,7 @@
402
466
  "Access Authorization and Control"
403
467
  ],
404
468
  "parameters": [],
469
+ "consumes": [],
405
470
  "security": [
406
471
  {
407
472
  "basic": []
@@ -444,6 +509,9 @@
444
509
  }
445
510
  }
446
511
  ],
512
+ "consumes": [
513
+ "application/json"
514
+ ],
447
515
  "security": [
448
516
  {
449
517
  "basic": []
@@ -465,6 +533,7 @@
465
533
  "Access Authorization and Control"
466
534
  ],
467
535
  "parameters": [],
536
+ "consumes": [],
468
537
  "security": [
469
538
  {
470
539
  "basic": []
@@ -49,7 +49,8 @@
49
49
  "parameters": [],
50
50
  "produces": [
51
51
  "application/json"
52
- ]
52
+ ],
53
+ "consumes": []
53
54
  }
54
55
  },
55
56
  "/users": {
@@ -91,7 +92,8 @@
91
92
  "parameters": [],
92
93
  "produces": [
93
94
  "application/json"
94
- ]
95
+ ],
96
+ "consumes": []
95
97
  }
96
98
  },
97
99
  "/users/{user_id}": {
@@ -205,7 +207,8 @@
205
207
  ],
206
208
  "produces": [
207
209
  "application/json"
208
- ]
210
+ ],
211
+ "consumes": []
209
212
  }
210
213
  }
211
214
  },
@@ -51,7 +51,8 @@
51
51
  "parameters": [],
52
52
  "produces": [
53
53
  "application/json"
54
- ]
54
+ ],
55
+ "consumes": []
55
56
  }
56
57
  },
57
58
  "/users": {
@@ -93,7 +94,8 @@
93
94
  "parameters": [],
94
95
  "produces": [
95
96
  "application/json"
96
- ]
97
+ ],
98
+ "consumes": []
97
99
  }
98
100
  },
99
101
  "/users/{user_id}": {
@@ -144,7 +146,8 @@
144
146
  ],
145
147
  "produces": [
146
148
  "application/json"
147
- ]
149
+ ],
150
+ "consumes": []
148
151
  }
149
152
  }
150
153
  },
@@ -39,6 +39,9 @@
39
39
  }
40
40
  }
41
41
  }
42
+ ],
43
+ "consumes": [
44
+ "application/json"
42
45
  ]
43
46
  }
44
47
  }
@@ -39,6 +39,9 @@
39
39
  }
40
40
  }
41
41
  }
42
+ ],
43
+ "consumes": [
44
+ "application/json"
42
45
  ]
43
46
  }
44
47
  }
@@ -78,7 +78,8 @@
78
78
  ],
79
79
  "produces": [
80
80
  "application/json"
81
- ]
81
+ ],
82
+ "consumes": []
82
83
  },
83
84
  "put": {
84
85
  "responses": {
@@ -158,6 +159,9 @@
158
159
  ],
159
160
  "produces": [
160
161
  "application/json"
162
+ ],
163
+ "consumes": [
164
+ "application/json"
161
165
  ]
162
166
  }
163
167
  }
@@ -78,7 +78,8 @@
78
78
  ],
79
79
  "produces": [
80
80
  "application/json"
81
- ]
81
+ ],
82
+ "consumes": []
82
83
  },
83
84
  "put": {
84
85
  "responses": {
@@ -158,6 +159,9 @@
158
159
  ],
159
160
  "produces": [
160
161
  "application/json"
162
+ ],
163
+ "consumes": [
164
+ "application/json"
161
165
  ]
162
166
  }
163
167
  }
@@ -92,7 +92,8 @@
92
92
  ],
93
93
  "produces": [
94
94
  "application/json"
95
- ]
95
+ ],
96
+ "consumes": []
96
97
  }
97
98
  },
98
99
  "/posts": {
@@ -172,6 +173,9 @@
172
173
  }
173
174
  }
174
175
  }
176
+ ],
177
+ "consumes": [
178
+ "application/json"
175
179
  ]
176
180
  }
177
181
  }
@@ -54,7 +54,8 @@
54
54
  ],
55
55
  "produces": [
56
56
  "application/json"
57
- ]
57
+ ],
58
+ "consumes": []
58
59
  }
59
60
  },
60
61
  "/posts": {
@@ -134,6 +135,9 @@
134
135
  }
135
136
  }
136
137
  }
138
+ ],
139
+ "consumes": [
140
+ "application/json"
137
141
  ]
138
142
  }
139
143
  }
@@ -138,7 +138,8 @@
138
138
  ],
139
139
  "produces": [
140
140
  "application/json"
141
- ]
141
+ ],
142
+ "consumes": []
142
143
  }
143
144
  }
144
145
  },
@@ -130,7 +130,8 @@
130
130
  ],
131
131
  "produces": [
132
132
  "application/json"
133
- ]
133
+ ],
134
+ "consumes": []
134
135
  }
135
136
  }
136
137
  },
@@ -27,6 +27,15 @@
27
27
  "description": "information about bob"
28
28
  }
29
29
  }
30
+ },
31
+ "Filter": {
32
+ "type": "object",
33
+ "properties": {
34
+ "status": {
35
+ "type": "array",
36
+ "items": {}
37
+ }
38
+ }
30
39
  }
31
40
  },
32
41
  "securityDefinitions": {},
@@ -27,6 +27,15 @@
27
27
  "description": "information about bob"
28
28
  }
29
29
  }
30
+ },
31
+ "Filter": {
32
+ "type": "object",
33
+ "properties": {
34
+ "status": {
35
+ "type": "array",
36
+ "items": {}
37
+ }
38
+ }
30
39
  }
31
40
  },
32
41
  "securityDefinitions": {},
@@ -75,7 +75,8 @@
75
75
  "parameters": [],
76
76
  "produces": [
77
77
  "application/json"
78
- ]
78
+ ],
79
+ "consumes": []
79
80
  }
80
81
  }
81
82
  },
@@ -53,7 +53,8 @@
53
53
  "parameters": [],
54
54
  "produces": [
55
55
  "application/json"
56
- ]
56
+ ],
57
+ "consumes": []
57
58
  }
58
59
  }
59
60
  },
@@ -29,6 +29,9 @@
29
29
  "default": 10
30
30
  }
31
31
  ],
32
+ "consumes": [
33
+ "application/json"
34
+ ],
32
35
  "security": [
33
36
  {
34
37
  "basic": []
@@ -29,6 +29,9 @@
29
29
  "default": 10
30
30
  }
31
31
  ],
32
+ "consumes": [
33
+ "application/json"
34
+ ],
32
35
  "security": [
33
36
  {
34
37
  "basic": []
@@ -29,6 +29,9 @@
29
29
  "default": 10
30
30
  }
31
31
  ],
32
+ "consumes": [
33
+ "application/json"
34
+ ],
32
35
  "security": [
33
36
  {
34
37
  "basic": []
@@ -52,7 +52,8 @@
52
52
  "parameters": [],
53
53
  "produces": [
54
54
  "application/json"
55
- ]
55
+ ],
56
+ "consumes": []
56
57
  }
57
58
  },
58
59
  "/users": {
@@ -89,7 +90,8 @@
89
90
  "parameters": [],
90
91
  "produces": [
91
92
  "application/json"
92
- ]
93
+ ],
94
+ "consumes": []
93
95
  }
94
96
  }
95
97
  },
@@ -37,7 +37,8 @@
37
37
  "parameters": [],
38
38
  "produces": [
39
39
  "application/json"
40
- ]
40
+ ],
41
+ "consumes": []
41
42
  }
42
43
  },
43
44
  "/users": {
@@ -74,7 +75,8 @@
74
75
  "parameters": [],
75
76
  "produces": [
76
77
  "application/json"
77
- ]
78
+ ],
79
+ "consumes": []
78
80
  }
79
81
  }
80
82
  },
@@ -34,6 +34,9 @@
34
34
  ]
35
35
  }
36
36
  }
37
+ ],
38
+ "consumes": [
39
+ "application/json"
37
40
  ]
38
41
  }
39
42
  }
@@ -34,6 +34,9 @@
34
34
  ]
35
35
  }
36
36
  }
37
+ ],
38
+ "consumes": [
39
+ "application/json"
37
40
  ]
38
41
  }
39
42
  }
@@ -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
+ }