apipie-postman 0.0.8 → 0.0.9

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/apipie-postman.rb +18 -20
  3. metadata +22 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 744c898d34eba39938c8961bbfa6047b26e75cec9ef9b46bdd9571622cd626d2
4
- data.tar.gz: 53d9f075566802e40802aeae23187747f88c50342b5d496584cc75c2d727038e
3
+ metadata.gz: 0dfa2e61723b3482b30e8c84f3959337683b0ffce10f01503b264c6f46829b89
4
+ data.tar.gz: b7f56bb490b953d318b999d34c3c19336ea0635a1689ca90479ae9d682291b28
5
5
  SHA512:
6
- metadata.gz: 55bf9987fd1e88cc716bc8a57ad095f114da7c4ed957c98e5664a7d92dfd4b60bbc666d7eb64dcb1dbdc69f208f6110bc2ffcbdc7e91f4ab683a3b72dcedba76
7
- data.tar.gz: bc1b255a5fd737ecd73f0c10b793cce9de2ff4d975b30549eb329928c6a58023d3b8e8e071aa878de86dac0011beb2c8976f367d627b69a507f647a8b6109541
6
+ metadata.gz: f46c44589d2af56f51e09cd31a06a012c3c15ac7bb773fa0f5502a9f5f0b40cf2051e3c238eb54f12b865f4983274479db9c11edfe7da40f0fa338dfabf62712
7
+ data.tar.gz: 97466a90c239c70be1a844e320af7f27e16f602eda28be93887786432beee804969b43a81de6237b7b2d55df27eb614b69b11c73b8cb32c5ec1d078e36e376be
@@ -38,26 +38,7 @@ module ApipiePostman
38
38
 
39
39
  docs_hashes.each do |doc_hash|
40
40
  doc_hash.each do |endpoint|
41
- req_body = if endpoint['request_data'].nil?
42
- {}
43
- else
44
- endpoint['request_data']
45
- end
46
-
47
- endpoints_hashes << {
48
- name: endpoint['title'] == 'Default' ? "#{endpoint['verb']} #{endpoint['path']}" : endpoint['title'],
49
- request: {
50
- url: "#{self.configuration.base_url}#{endpoint['path']}",
51
- method: endpoint['verb'],
52
- header: [],
53
- body: {
54
- mode: 'raw',
55
- raw: req_body.to_json
56
- },
57
- description: endpoint['title']
58
- },
59
- response: []
60
- }
41
+ endpoints_hashes << create_endpoint_hash(endpoint, endpoint['request_data'] || {})
61
42
  end
62
43
  end
63
44
 
@@ -92,4 +73,21 @@ module ApipiePostman
92
73
  col['name'] == self.configuration.postman_collection_name
93
74
  end.last
94
75
  end
76
+
77
+ def self.create_endpoint_hash(endpoint, req_body)
78
+ {
79
+ name: endpoint['title'] == 'Default' ? "#{endpoint['verb']} #{endpoint['path']}" : endpoint['title'],
80
+ request: {
81
+ url: "#{self.configuration.base_url}#{endpoint['path']}",
82
+ method: endpoint['verb'],
83
+ header: [],
84
+ body: {
85
+ mode: 'raw',
86
+ raw: req_body.to_json
87
+ },
88
+ description: endpoint['title']
89
+ },
90
+ response: []
91
+ }
92
+ end
95
93
  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.8
4
+ version: 0.0.9
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-08-30 00:00:00.000000000 Z
11
+ date: 2021-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -58,6 +58,26 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '3.10'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rubocop
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '1.22'
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 1.22.1
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '1.22'
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 1.22.1
61
81
  description: Use 'bundle exec apipie-postman' and 'rake apipie_postman' to generate
62
82
  the docs!
63
83
  email: vmotogna@gmail.com