open_api_import 0.8.1 → 0.8.2
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/open_api_import.rb +5 -0
- 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: 93185191b8740f9863913bc5868d3608f20b99f71508dabeecf3dadb0557523c
|
4
|
+
data.tar.gz: 44b12878fcfaf65f2677897744bf59507e48fd8ba8577c2a8e8eecaa4a3cc19b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dee50f9d4d6b627bb39c4af11db40cee221ca1b2dc8eb8ef0bde9a60fb85f1b962f92607a21a9f65a139d7c946c20225cff3788396e48566cc486d42fdbfad48
|
7
|
+
data.tar.gz: 4ab924a40063986778c5067baabadac8e1307b47108c23b0a2011051d0f69d3ab76accb28ea256b7582855f153b7628b830201aedd5cc286e330535f7f617959
|
data/lib/open_api_import.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2019-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oas_parser
|