apipie-rails 1.2.2 → 1.2.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 589dc3b1a0a39f1b2fae7fa811e27969b3f8de5c6eb2e187ca1c61e3d77edd5a
|
4
|
+
data.tar.gz: b99b476c03dadcce53f6fe2c4e712a9e6a30960762de9fead0b755ef3d6ebee2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 765673e5c7ca984ad30d1d1f815f583f92d3f9dfdd595228c74e73b9fac3fd0e60260f65e6f9e8eb6b19f24de1f8b814cb917f38bf312ec8a30c52b8e1eea901
|
7
|
+
data.tar.gz: 3afe26c57541633e04017eb022f4f526ed08c22b4d1a2ad7ca44364a49ce88f5e868e1651a468e5d0707325bf4abdc2fc15c1bbc8bebae0bc288b795ac6f0848
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
Changelog
|
2
2
|
===========
|
3
3
|
|
4
|
+
## [v1.2.3](https://github.com/Apipie/apipie-rails/tree/v1.2.3) (2023-10-11)
|
5
|
+
[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v1.2.2...v1.2.3)
|
6
|
+
* Fix param: Consider default_value: nil as valid config ([#894](https://github.com/Apipie/apipie-rails/pull/894)) (davidwessman)
|
7
|
+
|
4
8
|
## [v1.2.2](https://github.com/Apipie/apipie-rails/tree/v1.2.2) (2023-07-18)
|
5
9
|
[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v1.2.1...v1.2.2)
|
6
10
|
* Fixed Swagger warnings for properties ([#892](https://github.com/Apipie/apipie-rails/pull/892)) (shev-vadim-net)
|
@@ -71,7 +71,7 @@ class Apipie::Generator::Swagger::ParamDescription::Builder
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def for_default
|
74
|
-
return {}
|
74
|
+
return {} unless @param_description.options.key?(:default_value)
|
75
75
|
|
76
76
|
{
|
77
77
|
default: @param_description.options[:default_value],
|
data/lib/apipie/version.rb
CHANGED
@@ -57,8 +57,7 @@ describe Apipie::ApipiesController, type: :controller do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
it "succeeds on method details with the default language" do
|
60
|
-
allow(Apipie.configuration).to
|
61
|
-
allow(Apipie.configuration).to receive(:languages).and_return([])
|
60
|
+
allow(Apipie.configuration).to receive_messages(default_locale: "en", languages: [])
|
62
61
|
|
63
62
|
get :index, :params => { :version => "2.0", :resource => "architectures", :method => "index.en" }
|
64
63
|
|
@@ -102,23 +102,49 @@ describe Apipie::Generator::Swagger::ParamDescription::Builder do
|
|
102
102
|
|
103
103
|
subject { generated_block }
|
104
104
|
|
105
|
-
context 'when is
|
106
|
-
let(:base_param_description_options) { { required:
|
105
|
+
context 'when required is true' do
|
106
|
+
let(:base_param_description_options) { { required: true } }
|
107
|
+
|
108
|
+
it 'does not output an option without default warning' do
|
109
|
+
expect { subject }.not_to output(
|
110
|
+
/is optional but default value is not specified/
|
111
|
+
).to_stderr
|
112
|
+
end
|
113
|
+
end
|
107
114
|
|
108
|
-
|
109
|
-
|
115
|
+
context 'when required is false' do
|
116
|
+
context 'when default_value is nil' do
|
117
|
+
let(:base_param_description_options) do
|
118
|
+
{ required: false, default_value: nil }
|
119
|
+
end
|
110
120
|
|
111
|
-
it '
|
112
|
-
expect { subject }.
|
121
|
+
it 'will not warn' do
|
122
|
+
expect { subject }.not_to output(
|
123
|
+
/is optional but default value is not specified/
|
124
|
+
).to_stderr
|
113
125
|
end
|
114
126
|
end
|
115
|
-
end
|
116
127
|
|
117
|
-
|
118
|
-
|
128
|
+
context 'when default_value is 123' do
|
129
|
+
let(:base_param_description_options) do
|
130
|
+
{ required: false, default_value: 123 }
|
131
|
+
end
|
119
132
|
|
120
|
-
|
121
|
-
|
133
|
+
it 'will not warn' do
|
134
|
+
expect { subject }.not_to output(
|
135
|
+
/is optional but default value is not specified/
|
136
|
+
).to_stderr
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
context 'default_value not given' do
|
141
|
+
let(:base_param_description_options) { { required: false } }
|
142
|
+
|
143
|
+
it 'warns' do
|
144
|
+
expect { subject }.to output(
|
145
|
+
/is optional but default value is not specified/
|
146
|
+
).to_stderr
|
147
|
+
end
|
122
148
|
end
|
123
149
|
end
|
124
150
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apipie-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Pokorny
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-10-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -472,7 +472,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
472
472
|
- !ruby/object:Gem::Version
|
473
473
|
version: '0'
|
474
474
|
requirements: []
|
475
|
-
rubygems_version: 3.4.
|
475
|
+
rubygems_version: 3.4.18
|
476
476
|
signing_key:
|
477
477
|
specification_version: 4
|
478
478
|
summary: Rails REST API documentation tool
|