Skip to content

Commit

Permalink
Merge pull request #58 from funbox/fix_openapi_keys
Browse files Browse the repository at this point in the history
Fix openapi keys
  • Loading branch information
tuwilof authored Feb 2, 2023
2 parents f67a09a + efe199c commit 56e93f7
Show file tree
Hide file tree
Showing 8 changed files with 565 additions and 479 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change log

### 3.1.5 - 2023-02-02

* bug fixes
* fix keys for openapi 2 and 3 version

### 3.1.4 - 2023-02-01

* bug fixes
Expand Down
12 changes: 6 additions & 6 deletions lib/tomograph/openapi/openapi2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ def responses(resp, defi)
resp.inject([]) do |result, reponse|
if reponse[1]['schema']
result.push(
status: reponse[0],
body: schema(reponse[1]['schema'], defi),
'content-type': ''
'status' => reponse[0],
'body' => schema(reponse[1]['schema'], defi),
'content-type' => 'application/json'
)
else
result.push(
status: reponse[0],
body: {},
'content-type': ''
'status' => reponse[0],
'body' => {},
'content-type' => 'application/json'
)
end
end
Expand Down
12 changes: 6 additions & 6 deletions lib/tomograph/openapi/openapi3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ def responses(resp, defi)
if response[1]['content'].nil?
# TODO: 403Forbidden
result.push(
status: response[0],
body: {},
'content-type': ''
'status' => response[0],
'body' => {},
'content-type' => 'application/json'
)
elsif response[1]['content'].values[0]['schema']
result.push(
status: response[0],
body: schema(response[1]['content'].values[0]['schema'], defi),
'content-type': ''
'status' => response[0],
'body' => schema(response[1]['content'].values[0]['schema'], defi),
'content-type' => 'application/json'
)
else
result.push(
Expand Down
2 changes: 1 addition & 1 deletion lib/tomograph/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Tomograph
VERSION = '3.1.4'.freeze
VERSION = '3.1.5'.freeze
end
Loading

0 comments on commit 56e93f7

Please sign in to comment.