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: ebba895c2d4385bd3ccc47fe9663ca6e5b06f213308e09c5899e9f8b7ee6b74c
4
- data.tar.gz: 11f9e1572ae63af8b463b4c42a2d9c0b74f094f4ef523060f6948cc11172e089
3
+ metadata.gz: 589dc3b1a0a39f1b2fae7fa811e27969b3f8de5c6eb2e187ca1c61e3d77edd5a
4
+ data.tar.gz: b99b476c03dadcce53f6fe2c4e712a9e6a30960762de9fead0b755ef3d6ebee2
5
5
  SHA512:
6
- metadata.gz: 4fdb149329633f14091638be50d9b1f99c27bcdb4a5e279b042a835c16bc80b54fa750a7fe0fd69b3d0686badd82d93aef88b6b0c172a2ea9706509526f4dd0a
7
- data.tar.gz: 98d1d2a93f9403b47dea88edec25761986b6bdc0fb0db9ed83737f72eb5ac3b3c3b4b1b1eddab54d6db48366ad0a3006c4e7bf58ce257586730ea9a3add04faf
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 {} if @param_description.options[:default_value].blank?
74
+ return {} unless @param_description.options.key?(:default_value)
75
75
 
76
76
  {
77
77
  default: @param_description.options[:default_value],
@@ -1,3 +1,3 @@
1
1
  module Apipie
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -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 receive(:default_locale).and_return("en")
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 not required' do
106
- let(:base_param_description_options) { { required: false } }
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
- context 'and no default is given' do
109
- before { param_description_options.delete(:default) }
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 'outputs an option without default warning' do
112
- expect { subject }.to output(/is optional but default value is not specified/).to_stderr
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
- context 'when is required' do
118
- let(:base_param_description_options) { { required: true } }
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
- it 'does not output an option without default warning' do
121
- expect { subject }.not_to output(/is optional but default value is not specified/).to_stderr
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.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-07-18 00:00:00.000000000 Z
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.14
475
+ rubygems_version: 3.4.18
476
476
  signing_key:
477
477
  specification_version: 4
478
478
  summary: Rails REST API documentation tool