apipie-postman 0.0.10 → 1.0.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.
- checksums.yaml +4 -4
- data/lib/apipie-postman.rb +19 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb15fdaecb71ee97ad64d367620f122fc5ba847e682dfe5692c61b05d2fd8a98
|
4
|
+
data.tar.gz: 104174bf8f7dec3283fa1202e616c5d992d6496b8c6d99e3bb111e0293a0308f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6c6ddb7271df9f1ff84f4f939cc86c7cd1365fc71b8ec505d183841b2d6ca7be309ebf25e93c26cc4e843b09fb50c0102422459bc41e1869e46e7bc8d7e12d7
|
7
|
+
data.tar.gz: 6e31ad3dd6ccea47efb91c80fb566a84434ea173a06bcc397e3914555b2b4536497274da284924e8598a2b1b7a5c6e5cd49791747ab2b7b91ed50e25faaff925
|
data/lib/apipie-postman.rb
CHANGED
@@ -29,17 +29,19 @@ module ApipiePostman
|
|
29
29
|
def self.generate_docs
|
30
30
|
file = File.read('doc/apipie_examples.json')
|
31
31
|
@docs = JSON.parse(file)
|
32
|
-
|
33
|
-
endpoints_hashes = []
|
32
|
+
folder_hashes = []
|
34
33
|
|
35
|
-
@docs.
|
36
|
-
|
37
|
-
|
34
|
+
@docs = @docs.each_with_object({}) do |array, result|
|
35
|
+
key = array[0].to_s.split('#')[0]
|
36
|
+
(result[key] ||= []).concat(array[1])
|
37
|
+
end.transform_values(&:flatten)
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
@docs.each_key do |key|
|
40
|
+
key_endpoint_hashes = []
|
41
|
+
@docs[key].each do |endpoint|
|
42
|
+
key_endpoint_hashes << create_endpoint_hash(endpoint, endpoint['request_data'] || {})
|
42
43
|
end
|
44
|
+
folder_hashes << create_folder(key, key_endpoint_hashes)
|
43
45
|
end
|
44
46
|
|
45
47
|
body = {
|
@@ -49,7 +51,7 @@ module ApipiePostman
|
|
49
51
|
description: 'Test description',
|
50
52
|
schema: 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json'
|
51
53
|
},
|
52
|
-
item:
|
54
|
+
item: folder_hashes
|
53
55
|
}
|
54
56
|
}.to_json
|
55
57
|
|
@@ -90,4 +92,12 @@ module ApipiePostman
|
|
90
92
|
response: []
|
91
93
|
}
|
92
94
|
end
|
95
|
+
|
96
|
+
def self.create_folder(key, item_hashes)
|
97
|
+
{
|
98
|
+
name: key,
|
99
|
+
description: key,
|
100
|
+
item: item_hashes
|
101
|
+
}
|
102
|
+
end
|
93
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apipie-postman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Motogna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|