grape-swagger 2.0.0 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '019fb3e92a8ab175f13ce61d4a04098afc821ad9c085c64685de5effb5ad02ee'
4
- data.tar.gz: f2ffcf39c19988d5c04320800f8032e5bc3974b4d382e5c1a4b4ef76ceb1fcf3
3
+ metadata.gz: 892c461e0945d50d3b923b7ee89f22aa1ab429f286f2f0fc4de76fe16098eb6f
4
+ data.tar.gz: 6c702b542c93dd5a3c0c459bd1135471bc112da3d1d7a48a882b0f2416542f22
5
5
  SHA512:
6
- metadata.gz: 2bcbba86e30b0831543a9ddd7d1a2b09eca52ffc7d0eac61488e8bdaaefb87fc7c641f3526fe8234a0e95434f981119a90ca3c19a4268b9021fc5612548b273e
7
- data.tar.gz: 8dd8cc51b30feba0f79b985e03e2068bcd82819199415f316a292f38955ea26184c5c48848ccf613af8622d8ca7364efc9e59ab410628bfed2eb60ccbd4abba9
6
+ metadata.gz: 66d718bc68a0e596eefb35d0cab1334754da8df8b3be13ba2114e0dac1930270d228c441d6fc8933aaef6379c7bee99d18a60e159aa747715e466922c5bca433
7
+ data.tar.gz: a380f3d1ac174ff023e2874e09d336f287bba09d6187e055477ee5d6841cedea2a910fa5f04ca38b3be848356d1a6cf085f9183e37b85a8b2cc8418b5e9616f0
data/CHANGELOG.md CHANGED
@@ -9,7 +9,25 @@
9
9
  * Your contribution here.
10
10
 
11
11
 
12
- ### 2.0.0 (November7, 2023)
12
+ ### 2.0.2 (Februar 2, 2024)
13
+
14
+ #### Fixes
15
+
16
+ * [#918](https://github.com/ruby-grape/grape-swagger/pull/918): Fix params extension does not work when param_type is body - [@numbata](https://github.com/numbata)
17
+
18
+
19
+ ### 2.0.1 (Januar 2, 2024)
20
+
21
+ #### Features
22
+
23
+ * [#914](https://github.com/ruby-grape/grape-swagger/pull/914): Support Ruby 3.3 - [@LeFnord](https://github.com/LeFnord)
24
+
25
+ #### Fixes
26
+
27
+ * [#916](https://github.com/ruby-grape/grape-swagger/pull/916): Restore Ruby 3.0 support - [@godfat](https://github.com/godfat)
28
+
29
+
30
+ ### 2.0.0 (November 7, 2023)
13
31
 
14
32
  #### Features
15
33
 
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.metadata['rubygems_mfa_required'] = 'true'
16
16
 
17
- s.required_ruby_version = '>= 3.1'
17
+ s.required_ruby_version = '>= 3.0'
18
18
  s.add_runtime_dependency 'grape', '>= 1.7', '< 3.0'
19
19
  s.add_runtime_dependency 'rack-test', '~> 2'
20
20
 
@@ -86,6 +86,7 @@ module GrapeSwagger
86
86
  else
87
87
  document_as_property(param)
88
88
  end
89
+ add_extension_properties(properties[name], param)
89
90
 
90
91
  required << name if deletable?(param) && param[:required]
91
92
  end
@@ -102,6 +103,12 @@ module GrapeSwagger
102
103
  end
103
104
  end
104
105
 
106
+ def add_extension_properties(definition, values)
107
+ values.each do |key, value|
108
+ definition[key] = value if key.start_with?('x-')
109
+ end
110
+ end
111
+
105
112
  def document_as_property(param)
106
113
  property_keys.each_with_object({}) do |x, memo|
107
114
  next unless param.key?(x)
@@ -108,6 +108,10 @@ module GrapeSwagger
108
108
  set_additional_properties, additional_properties = parse_additional_properties(definitions, value_type)
109
109
  array_items[:additionalProperties] = additional_properties if set_additional_properties
110
110
 
111
+ if value_type.key?(:items)
112
+ GrapeSwagger::DocMethods::Extensions.add_extensions_to_root(value_type[:items], array_items)
113
+ end
114
+
111
115
  array_items
112
116
  end
113
117
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GrapeSwagger
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-swagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - LeFnord
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-11-17 00:00:00.000000000 Z
12
+ date: 2024-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: grape
@@ -96,14 +96,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
- version: '3.1'
99
+ version: '3.0'
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.4.21
106
+ rubygems_version: 3.5.5
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Add auto generated documentation to your Grape API that can be displayed