open_api_import 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/open_api_import.rb +12 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 378a413d85facc074f8b7e8f1231c4fb34fa22b59485ab68be86a9634ef6152c
4
- data.tar.gz: e7f07d0d064edf63db793934c300e4476244533d9efc7b28db65be72de720aa9
3
+ metadata.gz: 1a8f63ba6acbf1d3734f2e0e3b6df8edec9030a5ede1e14414dad974a1c3fab3
4
+ data.tar.gz: e4ef52b2d0f5cd2830951b8b1ffdf9843b2140c8b8da518bfbcdb5f345f7bb62
5
5
  SHA512:
6
- metadata.gz: bbb86c25b23282f190f62973f012d12b8c0323b2c3a925b70912ecc1b1219514d79dee7a43bb1d4978d5fdb5bef3ba86908e23c675118b95c8fd30c32873f6f0
7
- data.tar.gz: b3312d3571d8d95fcbaf97d535e4090345cc94877f61e8878ccd21a3f8958499b3b51be44f1bcac866f654e9ccf6d1eb938ecfe2624e8b3a9d6865ac61f4af08
6
+ metadata.gz: 5a35275273edc44be3dad32e73b90e0cf09d37612b91ac81a05e1c5be99f2d62ee1ff94f14861c9ab095ed44a2b6af48bf687a48f0ef126cf583bed17aab22d6
7
+ data.tar.gz: 9546b16e8f880e8b2678e591b917b593e2c69f2281dc540621e64c9b7222ec22b61a5d9345338390b7f1f39056d5263e181c4c8d62c6a9ee9d0ba5d70052ff24
@@ -311,6 +311,18 @@ class OpenApiImport
311
311
  output << description_parameters
312
312
  end
313
313
 
314
+ #for the case we still have some parameters on path that were not in 'parameters'
315
+ if path_txt.scan(/[^#]{\w+}/).size > 0
316
+ paramst = []
317
+ prms = path_txt.scan(/[^#]{(\w+)}/)
318
+ prms.each do |p|
319
+ paramst<<p[0].to_s.snake_case
320
+ path_txt.gsub!("{#{p[0]}}", "\#{#{p[0].to_s.snake_case}}")
321
+ end
322
+ paramst.concat params
323
+ params = paramst
324
+ end
325
+
314
326
  output << "def self.#{method_name} (#{params.join(", ")})"
315
327
 
316
328
  output << "{"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_api_import
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-30 00:00:00.000000000 Z
11
+ date: 2019-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oas_parser