apib2swagger 1.16.1 → 1.17.1

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 (71) 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/mson_to_json_schema.js +28 -9
  6. package/src/requests.js +18 -3
  7. package/src/responses.js +13 -1
  8. package/test/input/Issue-#72.md +43 -0
  9. package/test/input/OpenAPI3_Issue-#73.md +21 -0
  10. package/test/output/01. Simplest API.json +2 -1
  11. package/test/output/01. Simplest API.ref.json +2 -1
  12. package/test/output/02. Resource and Actions.json +6 -2
  13. package/test/output/02. Resource and Actions.ref.json +6 -2
  14. package/test/output/03. Named Resource and Actions.json +6 -2
  15. package/test/output/03. Named Resource and Actions.ref.json +6 -2
  16. package/test/output/04. Grouping Resources.json +6 -2
  17. package/test/output/04. Grouping Resources.ref.json +6 -2
  18. package/test/output/05. Responses.json +6 -2
  19. package/test/output/05. Responses.ref.json +6 -2
  20. package/test/output/06. Requests.json +6 -1
  21. package/test/output/06. Requests.ref.json +6 -1
  22. package/test/output/07. Parameters.json +8 -2
  23. package/test/output/07. Parameters.ref.json +8 -2
  24. package/test/output/08. Attributes.json +2 -1
  25. package/test/output/08. Attributes.ref.json +2 -1
  26. package/test/output/09. Advanced Attributes.json +7 -2
  27. package/test/output/09. Advanced Attributes.ref.json +7 -2
  28. package/test/output/10. Data Structures.json +7 -2
  29. package/test/output/10. Data Structures.ref.json +7 -2
  30. package/test/output/11. Resource Model.json +6 -1
  31. package/test/output/11. Resource Model.ref.json +6 -1
  32. package/test/output/12. Advanced Action.json +6 -3
  33. package/test/output/12. Advanced Action.ref.json +6 -3
  34. package/test/output/13. Named Endpoints.json +6 -0
  35. package/test/output/13. Named Endpoints.ref.json +6 -0
  36. package/test/output/Attributes.json +3 -0
  37. package/test/output/Attributes.ref.json +3 -0
  38. package/test/output/Gist Fox API + Auth.json +25 -7
  39. package/test/output/Gist Fox API + Auth.ref.json +25 -7
  40. package/test/output/Issue-#15.json +6 -3
  41. package/test/output/Issue-#15.ref.json +6 -3
  42. package/test/output/Issue-#23.json +3 -0
  43. package/test/output/Issue-#23.ref.json +3 -0
  44. package/test/output/Issue-#26.json +5 -1
  45. package/test/output/Issue-#26.ref.json +5 -1
  46. package/test/output/Issue-#29.json +5 -1
  47. package/test/output/Issue-#29.ref.json +5 -1
  48. package/test/output/Issue-#33.json +2 -1
  49. package/test/output/Issue-#33.ref.json +2 -1
  50. package/test/output/Issue-#36.json +2 -1
  51. package/test/output/Issue-#36.ref.json +2 -1
  52. package/test/output/Issue-#38.bearer.json +3 -0
  53. package/test/output/Issue-#38.json +3 -0
  54. package/test/output/Issue-#38.ref.json +3 -0
  55. package/test/output/Issue-#49.json +4 -2
  56. package/test/output/Issue-#49.ref.json +4 -2
  57. package/test/output/Issue-#57.json +3 -0
  58. package/test/output/Issue-#57.ref.json +3 -0
  59. package/test/output/Issue-#72.json +170 -0
  60. package/test/output/Issue-#72.ref.json +168 -0
  61. package/test/output/OpenAPI3_Issue-#73.json +69 -0
  62. package/test/output/OpenAPI3_Issue-#73.ref.json +63 -0
  63. package/test/output/Schema.json +9 -0
  64. package/test/output/Schema.ref.json +9 -0
  65. package/test/output/apiblueprint_uber.json +10 -5
  66. package/test/output/apiblueprint_uber.ref.json +10 -5
  67. package/test/output/apiblueprint_valid_simple.json +25 -7
  68. package/test/output/apiblueprint_valid_simple.ref.json +25 -7
  69. package/test/output/schema_without_body.json +52 -49
  70. package/test/output/schema_without_body.ref.json +52 -49
  71. package/test/test.js +3 -1
@@ -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": []
@@ -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": []
@@ -1,52 +1,55 @@
1
1
  {
2
- "swagger": "2.0",
3
- "info": {
4
- "title": "",
5
- "version": "",
6
- "description": ""
7
- },
8
- "paths": {
9
- "/some/resource": {
10
- "post": {
11
- "responses": {
12
- "200": {
13
- "description": "OK",
14
- "headers": {},
15
- "examples": {
16
- "text/plain": ""
17
- }
18
- }
19
- },
20
- "summary": "Some resource",
21
- "operationId": "Some resource",
22
- "description": "",
23
- "tags": [],
24
- "parameters": [
25
- {
26
- "name": "body",
27
- "in": "body",
28
- "schema": {
29
- "type": "object",
30
- "properties": {
31
- "prop1": {
32
- "type": "string"
33
- }
34
- },
35
- "required": [
36
- "prop1"
37
- ]
38
- }
39
- }
40
- ],
41
- "produces": [
42
- "text/plain"
43
- ]
2
+ "swagger": "2.0",
3
+ "info": {
4
+ "title": "",
5
+ "version": "",
6
+ "description": ""
7
+ },
8
+ "paths": {
9
+ "/some/resource": {
10
+ "post": {
11
+ "responses": {
12
+ "200": {
13
+ "description": "OK",
14
+ "headers": {},
15
+ "examples": {
16
+ "text/plain": ""
44
17
  }
45
- }
46
- },
47
- "definitions": {
48
- "Some resource": {}
49
- },
50
- "securityDefinitions": {},
51
- "tags": []
18
+ }
19
+ },
20
+ "summary": "Some resource",
21
+ "operationId": "Some resource",
22
+ "description": "",
23
+ "tags": [],
24
+ "parameters": [
25
+ {
26
+ "name": "body",
27
+ "in": "body",
28
+ "schema": {
29
+ "type": "object",
30
+ "properties": {
31
+ "prop1": {
32
+ "type": "string"
33
+ }
34
+ },
35
+ "required": [
36
+ "prop1"
37
+ ]
38
+ }
39
+ }
40
+ ],
41
+ "produces": [
42
+ "text/plain"
43
+ ],
44
+ "consumes": [
45
+ "application/json"
46
+ ]
47
+ }
48
+ }
49
+ },
50
+ "definitions": {
51
+ "Some resource": {}
52
+ },
53
+ "securityDefinitions": {},
54
+ "tags": []
52
55
  }
@@ -1,52 +1,55 @@
1
1
  {
2
- "swagger": "2.0",
3
- "info": {
4
- "title": "",
5
- "version": "",
6
- "description": ""
7
- },
8
- "paths": {
9
- "/some/resource": {
10
- "post": {
11
- "responses": {
12
- "200": {
13
- "description": "OK",
14
- "headers": {},
15
- "examples": {
16
- "text/plain": ""
17
- }
18
- }
19
- },
20
- "summary": "Some resource",
21
- "operationId": "Some resource",
22
- "description": "",
23
- "tags": [],
24
- "parameters": [
25
- {
26
- "name": "body",
27
- "in": "body",
28
- "schema": {
29
- "type": "object",
30
- "properties": {
31
- "prop1": {
32
- "type": "string"
33
- }
34
- },
35
- "required": [
36
- "prop1"
37
- ]
38
- }
39
- }
40
- ],
41
- "produces": [
42
- "text/plain"
43
- ]
2
+ "swagger": "2.0",
3
+ "info": {
4
+ "title": "",
5
+ "version": "",
6
+ "description": ""
7
+ },
8
+ "paths": {
9
+ "/some/resource": {
10
+ "post": {
11
+ "responses": {
12
+ "200": {
13
+ "description": "OK",
14
+ "headers": {},
15
+ "examples": {
16
+ "text/plain": ""
44
17
  }
45
- }
46
- },
47
- "definitions": {
48
- "Some resource": {}
49
- },
50
- "securityDefinitions": {},
51
- "tags": []
18
+ }
19
+ },
20
+ "summary": "Some resource",
21
+ "operationId": "Some resource",
22
+ "description": "",
23
+ "tags": [],
24
+ "parameters": [
25
+ {
26
+ "name": "body",
27
+ "in": "body",
28
+ "schema": {
29
+ "type": "object",
30
+ "properties": {
31
+ "prop1": {
32
+ "type": "string"
33
+ }
34
+ },
35
+ "required": [
36
+ "prop1"
37
+ ]
38
+ }
39
+ }
40
+ ],
41
+ "produces": [
42
+ "text/plain"
43
+ ],
44
+ "consumes": [
45
+ "application/json"
46
+ ]
47
+ }
48
+ }
49
+ },
50
+ "definitions": {
51
+ "Some resource": {}
52
+ },
53
+ "securityDefinitions": {},
54
+ "tags": []
52
55
  }
package/test/test.js CHANGED
@@ -47,6 +47,7 @@ var remote = 'https://raw.githubusercontent.com/apiaryio/api-blueprint/format-1A
47
47
  'Issue-#38.md',
48
48
  'Issue-#49.md',
49
49
  'Issue-#57.md',
50
+ 'Issue-#72.md',
50
51
  'apiblueprint_uber.md',
51
52
  'apiblueprint_valid_simple.md',
52
53
  'schema_without_body.md',
@@ -56,7 +57,8 @@ var remote = 'https://raw.githubusercontent.com/apiaryio/api-blueprint/format-1A
56
57
  'OpenAPI3_includes.md',
57
58
  'OpenAPI3_attributes.md',
58
59
  'OpenAPI3_Issue-#58.md',
59
- 'OpenAPI3_Issue-#66.md'
60
+ 'OpenAPI3_Issue-#66.md',
61
+ 'OpenAPI3_Issue-#73.md'
60
62
  ];
61
63
 
62
64
  var fetch = function (file) {