Skip to content

Commit

Permalink
Merge pull request #65 from tuwilof/fix_other_content_type_request
Browse files Browse the repository at this point in the history
Fix other content type request
  • Loading branch information
tuwilof authored Dec 8, 2024
2 parents 69ee57b + 963b8f2 commit 6d1a040
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 61 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.7 - 2024-12-08

* bug fixes
* fix other content-type for request OpenAPI 3

### 3.2.6 - 2024-12-08

* 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 @@ -17,7 +17,7 @@ def to_tomogram
result.push(Tomograph::Tomogram::Action.new(
path: "#{@prefix}#{path}",
method: method.upcase,
content_type: action_definition[method]['requestBody'] && action_definition[method]['requestBody']['content'].keys[0] == 'application/json' ? action_definition[method]['requestBody']['content'].keys[0] : nil,
content_type: action_definition[method]['requestBody'].nil? ? nil : action_definition[method]['requestBody']['content'].keys[0],
requests: [schema_new(valuekey(aj, 'schema'), @documentation['definitions'])].compact,
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.6'.freeze
VERSION = '3.2.7'.freeze
end
118 changes: 59 additions & 59 deletions spec/fixtures/tomogram/spree.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@
"properties": {
"error": {
"type": "string",
"default": "You are not authorized to access this page.",
"example": "You are not authorized to access this page."
"example": "You are not authorized to access this page.",
"default": "You are not authorized to access this page."
}
}
},
Expand All @@ -195,7 +195,7 @@
{
"path": "/account",
"method": "POST",
"content-type": null,
"content-type": "application/vnd.api+json",
"requests": [

],
Expand Down Expand Up @@ -396,7 +396,7 @@
{
"path": "/account",
"method": "PATCH",
"content-type": null,
"content-type": "application/vnd.api+json",
"requests": [

],
Expand Down Expand Up @@ -697,8 +697,8 @@
"properties": {
"error": {
"type": "string",
"default": "You are not authorized to access this page.",
"example": "You are not authorized to access this page."
"example": "You are not authorized to access this page.",
"default": "You are not authorized to access this page."
}
}
},
Expand All @@ -710,7 +710,7 @@
{
"path": "/account/addresses",
"method": "POST",
"content-type": null,
"content-type": "application/vnd.api+json",
"requests": [

],
Expand Down Expand Up @@ -810,8 +810,8 @@
"properties": {
"error": {
"type": "string",
"default": "You are not authorized to access this page.",
"example": "You are not authorized to access this page."
"example": "You are not authorized to access this page.",
"default": "You are not authorized to access this page."
}
}
},
Expand All @@ -823,7 +823,7 @@
{
"path": "/account/addresses/{id}",
"method": "PATCH",
"content-type": null,
"content-type": "application/vnd.api+json",
"requests": [

],
Expand Down Expand Up @@ -923,8 +923,8 @@
"properties": {
"error": {
"type": "string",
"default": "You are not authorized to access this page.",
"example": "You are not authorized to access this page."
"example": "You are not authorized to access this page.",
"default": "You are not authorized to access this page."
}
}
},
Expand Down Expand Up @@ -1087,8 +1087,8 @@
"properties": {
"error": {
"type": "string",
"default": "You are not authorized to access this page.",
"example": "You are not authorized to access this page."
"example": "You are not authorized to access this page.",
"default": "You are not authorized to access this page."
}
}
},
Expand Down Expand Up @@ -1250,8 +1250,8 @@
"properties": {
"error": {
"type": "string",
"default": "You are not authorized to access this page.",
"example": "You are not authorized to access this page."
"example": "You are not authorized to access this page.",
"default": "You are not authorized to access this page."
}
}
},
Expand Down Expand Up @@ -1969,8 +1969,8 @@
"properties": {
"error": {
"type": "string",
"default": "You are not authorized to access this page.",
"example": "You are not authorized to access this page."
"example": "You are not authorized to access this page.",
"default": "You are not authorized to access this page."
}
}
},
Expand Down Expand Up @@ -2686,8 +2686,8 @@
"properties": {
"error": {
"type": "string",
"default": "You are not authorized to access this page.",
"example": "You are not authorized to access this page."
"example": "You are not authorized to access this page.",
"default": "You are not authorized to access this page."
}
}
},
Expand Down Expand Up @@ -3403,8 +3403,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -4824,8 +4824,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand All @@ -4837,7 +4837,7 @@
{
"path": "/cart/add_item",
"method": "POST",
"content-type": null,
"content-type": "application/vnd.api+json",
"requests": [

],
Expand Down Expand Up @@ -5541,8 +5541,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand All @@ -5554,7 +5554,7 @@
{
"path": "/cart/set_quantity",
"method": "PATCH",
"content-type": null,
"content-type": "application/vnd.api+json",
"requests": [

],
Expand Down Expand Up @@ -6983,8 +6983,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -7700,8 +7700,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand All @@ -7713,7 +7713,7 @@
{
"path": "/cart/apply_coupon_code",
"method": "PATCH",
"content-type": null,
"content-type": "application/vnd.api+json",
"requests": [

],
Expand Down Expand Up @@ -9260,8 +9260,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand All @@ -9273,7 +9273,7 @@
{
"path": "/checkout",
"method": "PATCH",
"content-type": null,
"content-type": "application/vnd.api+json",
"requests": [

],
Expand Down Expand Up @@ -9998,8 +9998,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -10736,8 +10736,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -11474,8 +11474,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -12212,8 +12212,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -12950,8 +12950,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -13688,8 +13688,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -13765,8 +13765,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -14004,8 +14004,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -15462,8 +15462,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -16400,8 +16400,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -16662,8 +16662,8 @@
"properties": {
"error": {
"type": "string",
"default": "The resource you were looking for could not be found.",
"example": "The resource you were looking for could not be found."
"example": "The resource you were looking for could not be found.",
"default": "The resource you were looking for could not be found."
}
}
},
Expand Down Expand Up @@ -16807,4 +16807,4 @@
],
"resource": ""
}
]
]

0 comments on commit 6d1a040

Please sign in to comment.