Skip to content

Commit

Permalink
Merge pull request #62 from tuwilof/fix_content_type_openapi3
Browse files Browse the repository at this point in the history
Fix content type openapi3
  • Loading branch information
tuwilof authored Aug 7, 2024
2 parents 15faf8e + 490780a commit df3565e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 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.2.4 - 2024-08-08

* bug fixes
* fix content type for open api for request

### 3.2.3 - 2024-05-28

* bug fixes
Expand Down
2 changes: 1 addition & 1 deletion lib/tomograph/openapi/openapi3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def to_tomogram
result.push(Tomograph::Tomogram::Action.new(
path: "#{@prefix}#{path}",
method: method.upcase,
content_type: '',
content_type: action_definition[method]['requestBody'] && action_definition[method]['requestBody']['content'].keys[0] == 'application/json' ? action_definition[method]['requestBody']['content'].keys[0] : '',
requests: [],
responses: responses(action_definition[method]['responses']),
resource: ''
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.2.3'.freeze
VERSION = '3.2.4'.freeze
end
14 changes: 7 additions & 7 deletions spec/fixtures/openapi3/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"path": "/owner/event",
"method": "POST",
"content-type": "",
"content-type": "application/json",
"requests": [],
"responses": [
{
Expand Down Expand Up @@ -33,7 +33,7 @@
{
"path": "/owner/event",
"method": "PUT",
"content-type": "",
"content-type": "application/json",
"requests": [],
"responses": [
{
Expand Down Expand Up @@ -203,7 +203,7 @@
{
"path": "/owner/user",
"method": "PUT",
"content-type": "",
"content-type": "application/json",
"requests": [],
"responses": [
{
Expand Down Expand Up @@ -314,7 +314,7 @@
{
"path": "/guest/user",
"method": "POST",
"content-type": "",
"content-type": "application/json",
"requests": [],
"responses": [
{
Expand Down Expand Up @@ -345,7 +345,7 @@
{
"path": "/guest/user",
"method": "PUT",
"content-type": "",
"content-type": "application/json",
"requests": [],
"responses": [
{
Expand Down Expand Up @@ -510,7 +510,7 @@
{
"path": "/guest/reaction",
"method": "POST",
"content-type": "",
"content-type": "application/json",
"requests": [],
"responses": [
{
Expand Down Expand Up @@ -769,7 +769,7 @@
{
"path": "/admin/suspect",
"method": "PUT",
"content-type": "",
"content-type": "application/json",
"requests": [],
"responses": [
{
Expand Down

0 comments on commit df3565e

Please sign in to comment.