Skip to content

Commit

Permalink
supported @type on examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario.RuizSanchez committed Aug 16, 2019
1 parent 59ff72b commit 3d898b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/open_api_import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,12 @@ class << self
# for the case only type supplied but nothing else for the array
response_example << "[\"#{v[:schema][:items][:type]}\"]"
end
response_example.each do |rs|
#(@type Google) for the case in example the key is something like: @type:
if rs.match?(/^\s*@\w+:/)
rs.gsub!(/@(\w+):/,"'@\1':")
end
end
return response_example
end

Expand Down
2 changes: 1 addition & 1 deletion open_api_import.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'open_api_import'
s.version = '0.8.3'
s.version = '0.8.4'
s.summary = "OpenApiImport -- Import a Swagger or Open API file and create a Ruby Request Hash file including all requests and responses with all the examples. The file can be in JSON or YAML"
s.description = "OpenApiImport -- Import a Swagger or Open API file and create a Ruby Request Hash file including all requests and responses with all the examples. The file can be in JSON or YAML"
s.authors = ["Mario Ruiz"]
Expand Down

0 comments on commit 3d898b9

Please sign in to comment.