open_api_import 0.8.1 → 0.8.2

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 +5 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44178e940d05e8bd9896eac2604ae2a930cdaa4b737cd7b2790ed0ebf5c6cbab
4
- data.tar.gz: 29253b56c6583ff35d2985a4c3e095ac9baad3a8df5dcc074e93959e71ad0602
3
+ metadata.gz: 93185191b8740f9863913bc5868d3608f20b99f71508dabeecf3dadb0557523c
4
+ data.tar.gz: 44b12878fcfaf65f2677897744bf59507e48fd8ba8577c2a8e8eecaa4a3cc19b
5
5
  SHA512:
6
- metadata.gz: bd98ec64a05bad40b31f6746c40ac20f05c09f84ac6cd28677198a109d3a68a3e427418371b171ff00bec4f40d1b4d8f5f96752147a5cdc1e7a6a0d303082dbe
7
- data.tar.gz: a1ec8bb64c83c3dbd7b97c4bb8a323e9ff3cb55d560e87c7061cff4fd1ed639fb75a21c6b828be84a7f470f2c421d1e5a17dea2a043c0c81f0dbe2fa80c7276d
6
+ metadata.gz: dee50f9d4d6b627bb39c4af11db40cee221ca1b2dc8eb8ef0bde9a60fb85f1b962f92607a21a9f65a139d7c946c20225cff3788396e48566cc486d42fdbfad48
7
+ data.tar.gz: 4ab924a40063986778c5067baabadac8e1307b47108c23b0a2011051d0f69d3ab76accb28ea256b7582855f153b7628b830201aedd5cc286e330535f7f617959
@@ -218,6 +218,7 @@ class OpenApiImport
218
218
  cont[:responses].each do |k, v|
219
219
  response_example = []
220
220
  response_example = get_response_examples(v)
221
+
221
222
  data_pattern += get_patterns(k, v[:schema]) if v.key?(:schema)
222
223
  v[:description] = v[:description].to_s.gsub("'", %q(\\\'))
223
224
 
@@ -586,6 +587,9 @@ class OpenApiImport
586
587
  if val.key?(:properties) and !val.key?(:example) and !val.key?(:type)
587
588
  val[:type]='object'
588
589
  end
590
+ if val.key?(:items) and !val.key?(:example) and !val.key?(:type)
591
+ val[:type]='array'
592
+ end
589
593
  if val.key?(:example)
590
594
  example << if val[:example].is_a?(String) or val[:example].is_a?(Time)
591
595
  " #{prop.to_sym}: \"#{val[:example]}\", "
@@ -739,6 +743,7 @@ class OpenApiImport
739
743
  response_example << "]"
740
744
  end
741
745
  end
746
+
742
747
  elsif v.key?(:schema) and v[:schema].key?(:items) and v[:schema][:items].key?(:type)
743
748
  # for the case only type supplied but nothing else for the array
744
749
  response_example << "[\"#{v[:schema][:items][:type]}\"]"
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.8.1
4
+ version: 0.8.2
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-06-21 00:00:00.000000000 Z
11
+ date: 2019-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oas_parser