Skip to content

Commit

Permalink
added parameters from path to all methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario.RuizSanchez committed Mar 11, 2019
1 parent 4d32fa5 commit b96b7d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/open_api_import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def self.from(swagger_file, create_method_name: :operation_id, include_responses
raw.each do |met, cont|
if met != :parameters
if raw[met].key?(:parameters)
#todo: check if in some cases the parameters on the method can be added to the ones in the path
#raw[met][:parameters] = raw[met][:parameters] & raw[:parameters]
#in case parameters for all methods in path is present
raw[met][:parameters] = raw[met][:parameters] + raw[:parameters]
else
raw[met][:parameters] = raw[:parameters]
end
Expand All @@ -136,7 +136,6 @@ def self.from(swagger_file, create_method_name: :operation_id, include_responses

# for the case operationId is missing
cont[:operationId] = "unknown" unless cont.key?(:operationId)

if create_method_name == :path
method_name = (met.to_s + "_" + path.path.to_s).snake_case
method_name.chop! if method_name[-1] == "_"
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.6.1'
s.version = '0.6.2'
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 b96b7d3

Please sign in to comment.