Skip to content

Commit

Permalink
Support header in OAS2/3
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Aug 18, 2023
1 parent 4eebe07 commit c9cedbc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@

| Specification | Format | URL | Method | Param | Header | WS |
|------------------------|---------|-----|--------|-------|--------|----|
| OAS 2.0 (Swagger 2.0) | JSON |||| X | X |
| OAS 2.0 (Swagger 2.0) | YAML |||| X | X |
| OAS 3.0 | JSON |||| X | X |
| OAS 3.0 | YAML |||| X | X |
| OAS 2.0 (Swagger 2.0) | JSON |||| | X |
| OAS 2.0 (Swagger 2.0) | YAML |||| | X |
| OAS 3.0 | JSON |||| | X |
| OAS 3.0 | YAML |||| | X |

## Installation
### Homebrew (macOS)
Expand Down
6 changes: 6 additions & 0 deletions src/analyzer/analyzers/analyzer_oas2.cr
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class AnalyzerOAS2 < Analyzer
elsif param_obj["in"] == "formData"
param = Param.new(param_name, "", "form")
params << param
elsif param_obj["in"] == "header"
param = Param.new(param_name, "", "header")
params << param
end
end
@result << Endpoint.new(base_path + path, method.upcase, params)
Expand Down Expand Up @@ -65,6 +68,9 @@ class AnalyzerOAS2 < Analyzer
elsif param_obj["in"] == "formData"
param = Param.new(param_name, "", "form")
params << param
elsif param_obj["in"] == "header"
param = Param.new(param_name, "", "header")
params << param
end
end
@result << Endpoint.new(base_path + path.to_s, method.to_s.upcase, params)
Expand Down
6 changes: 6 additions & 0 deletions src/analyzer/analyzers/analyzer_oas3.cr
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class AnalyzerOAS3 < Analyzer
if param_obj["in"] == "query"
param = Param.new(param_name, "", "query")
params << param
elsif param_obj["in"] == "header"
param = Param.new(param_name, "", "header")
params << param
end
end
end
Expand Down Expand Up @@ -89,6 +92,9 @@ class AnalyzerOAS3 < Analyzer
if param_obj["in"] == "query"
param = Param.new(param_name, "", "query")
params << param
elsif param_obj["in"] == "header"
param = Param.new(param_name, "", "header")
params << param
end
end
end
Expand Down

0 comments on commit c9cedbc

Please sign in to comment.