Skip to content

Commit

Permalink
(#102) Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Sep 21, 2023
1 parent 881393e commit 7ee29f1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/analyzer/analyzers/analyzer_oas2.cr
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ class AnalyzerOAS2 < Analyzer
content = File.read(swagger_json, encoding: "utf-8", invalid: :skip)
json_obj = JSON.parse(content)
base_path = @url
if json_obj["basePath"].to_s != ""
base_path = base_path + json_obj["basePath"].to_s
begin
if json_obj["basePath"].to_s != ""
base_path = base_path + json_obj["basePath"].to_s
end
rescue
end
json_obj["paths"].as_h.each do |path, path_obj|
path_obj.as_h.each do |method, method_obj|
Expand Down Expand Up @@ -49,8 +52,11 @@ class AnalyzerOAS2 < Analyzer
content = File.read(swagger_yaml, encoding: "utf-8", invalid: :skip)
yaml_obj = YAML.parse(content)
base_path = @url
if yaml_obj["basePath"].to_s != ""
base_path = base_path + yaml_obj["basePath"].to_s
begin
if yaml_obj["basePath"].to_s != ""
base_path = base_path + yaml_obj["basePath"].to_s
end
rescue
end
yaml_obj["paths"].as_h.each do |path, path_obj|
path_obj.as_h.each do |method, method_obj|
Expand Down

0 comments on commit 7ee29f1

Please sign in to comment.