From 88a8c73d068b8d75bc1e739cdd7f0f2b3c96f388 Mon Sep 17 00:00:00 2001 From: "Dmitry.Yefimov" Date: Thu, 8 Aug 2024 00:50:40 +0400 Subject: [PATCH 1/2] fix content type for open api --- lib/tomograph/openapi/openapi3.rb | 2 +- spec/fixtures/openapi3/definitions.json | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/tomograph/openapi/openapi3.rb b/lib/tomograph/openapi/openapi3.rb index 33da1f2..53b0214 100644 --- a/lib/tomograph/openapi/openapi3.rb +++ b/lib/tomograph/openapi/openapi3.rb @@ -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: '' diff --git a/spec/fixtures/openapi3/definitions.json b/spec/fixtures/openapi3/definitions.json index aad8862..fbb4f48 100644 --- a/spec/fixtures/openapi3/definitions.json +++ b/spec/fixtures/openapi3/definitions.json @@ -2,7 +2,7 @@ { "path": "/owner/event", "method": "POST", - "content-type": "", + "content-type": "application/json", "requests": [], "responses": [ { @@ -33,7 +33,7 @@ { "path": "/owner/event", "method": "PUT", - "content-type": "", + "content-type": "application/json", "requests": [], "responses": [ { @@ -203,7 +203,7 @@ { "path": "/owner/user", "method": "PUT", - "content-type": "", + "content-type": "application/json", "requests": [], "responses": [ { @@ -314,7 +314,7 @@ { "path": "/guest/user", "method": "POST", - "content-type": "", + "content-type": "application/json", "requests": [], "responses": [ { @@ -345,7 +345,7 @@ { "path": "/guest/user", "method": "PUT", - "content-type": "", + "content-type": "application/json", "requests": [], "responses": [ { @@ -510,7 +510,7 @@ { "path": "/guest/reaction", "method": "POST", - "content-type": "", + "content-type": "application/json", "requests": [], "responses": [ { @@ -769,7 +769,7 @@ { "path": "/admin/suspect", "method": "PUT", - "content-type": "", + "content-type": "application/json", "requests": [], "responses": [ { From 490780aff8808956d7e81621d9b55005fffd6a74 Mon Sep 17 00:00:00 2001 From: "Dmitry.Yefimov" Date: Thu, 8 Aug 2024 00:51:42 +0400 Subject: [PATCH 2/2] 3.2.4 --- CHANGELOG.md | 5 +++++ lib/tomograph/version.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4a1b5a..a96b8eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/tomograph/version.rb b/lib/tomograph/version.rb index b6b3ee7..d5db316 100644 --- a/lib/tomograph/version.rb +++ b/lib/tomograph/version.rb @@ -1,3 +1,3 @@ module Tomograph - VERSION = '3.2.3'.freeze + VERSION = '3.2.4'.freeze end