apipie-rails 1.4.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +20 -5
- data/CHANGELOG.md +13 -0
- data/README.md +2 -2
- data/config/locales/it.yml +10 -0
- data/lib/apipie/application.rb +2 -5
- data/lib/apipie/dsl_definition.rb +41 -43
- data/lib/apipie/extractor/collector.rb +1 -0
- data/lib/apipie/extractor.rb +1 -3
- data/lib/apipie/generator/swagger/config.rb +2 -2
- data/lib/apipie/param_description.rb +1 -1
- data/lib/apipie/response_description.rb +2 -6
- data/lib/apipie/static_dispatcher.rb +1 -3
- data/lib/apipie/validator.rb +3 -9
- data/lib/apipie/version.rb +1 -1
- data/lib/tasks/apipie.rake +6 -6
- data/rel-eng/gem_release.ipynb +79 -20
- data/spec/dummy/config/boot.rb +3 -1
- data/spec/lib/apipie/extractor/collector_spec.rb +7 -1
- data/spec/spec_helper.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac4c24841aa8ff06fd2d1b86ee4ab64ff873a531adb5bdd0e1d7e9f39cfd0072
|
4
|
+
data.tar.gz: 81896d38d3352ae7f9f77a24cbe193f9568c9b470302ecc69a2dfc2a3838a628
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 273e9bf75332d36f83ce0bf37a05ddb70d710557e995ef09f7789d45d251193304b204a861e3eb76421d0a66396966ec8c09ae6e32152ecaaddf001b7ab9cf74
|
7
|
+
data.tar.gz: 4da0ec44eb77de5d88f96cf20a43a38770d86c7f28d9bd53ce8ade4177e2f29592baaa9a8e5ce5d834d3b5fa48f4280b3188c9786f2d5a827b93961d309058e9
|
data/.github/workflows/build.yml
CHANGED
@@ -4,21 +4,36 @@ on: [push, pull_request]
|
|
4
4
|
|
5
5
|
jobs:
|
6
6
|
test:
|
7
|
-
runs-on: ubuntu-
|
7
|
+
runs-on: ubuntu-24.04
|
8
8
|
strategy:
|
9
9
|
fail-fast: false
|
10
10
|
matrix:
|
11
|
-
rails: ["7.1", "7.0", "6.1", "6.0"]
|
12
|
-
ruby: ["3.3", "3.2", "3.1", "3.0", "2.7"]
|
11
|
+
rails: ["8.0", "7.2", "7.1", "7.0", "6.1", "6.0"]
|
12
|
+
ruby: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7"]
|
13
13
|
include:
|
14
|
-
- rails: "7.1"
|
15
|
-
ruby: "3.4.0-preview1"
|
16
14
|
- rails: "5.2"
|
17
15
|
ruby: "2.7.8"
|
18
16
|
- rails: "5.1"
|
19
17
|
ruby: "2.6.10"
|
20
18
|
- rails: "5.0"
|
21
19
|
ruby: "2.6.10"
|
20
|
+
exclude:
|
21
|
+
- rails: "6.0"
|
22
|
+
ruby: "3.4"
|
23
|
+
- rails: "6.1"
|
24
|
+
ruby: "3.4"
|
25
|
+
- rails: "7.0"
|
26
|
+
ruby: "3.4"
|
27
|
+
- rails: "7.2"
|
28
|
+
ruby: "2.7"
|
29
|
+
- rails: "7.2"
|
30
|
+
ruby: "3.0"
|
31
|
+
- rails: "8.0"
|
32
|
+
ruby: "2.7"
|
33
|
+
- rails: "8.0"
|
34
|
+
ruby: "3.0"
|
35
|
+
- rails: "8.0"
|
36
|
+
ruby: "3.1"
|
22
37
|
|
23
38
|
env:
|
24
39
|
RAILS_VERSION: ${{ matrix.rails }}
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
Changelog
|
2
2
|
===========
|
3
|
+
## [v1.5.0](https://github.com/Apipie/apipie-rails/tree/v1.5.0) (2025-08-19)
|
4
|
+
[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v1.4.2...v1.5.0)
|
5
|
+
* Don't collect records without an action (Evgeni Golov)
|
6
|
+
* Update test matrix: rails 7.2, 8.0, ruby 3.4 [#960](https://github.com/Apipie/apipie-rails/pull/960) (Evgeni Golov)
|
7
|
+
* Fix activesupport::deprecation.warn deprecation (Jonathan Biolaz)
|
8
|
+
* Rubocop autofix (Evgeni Golov)
|
9
|
+
* Update ci workflow to run on ubuntu 24.04 (Evgeni Golov)
|
10
|
+
* Fix issue with loading rails logger in tests (Eric Helms)
|
11
|
+
* Update link for rdoc in readme (Panos Dalitsouris)
|
12
|
+
* Fix the decimalvalidator header in readme.md [#945](https://github.com/Apipie/apipie-rails/pull/945) (Ewoud Kohl van Wijngaarden)
|
13
|
+
* Rename render_page in apipie.rake to render_apipie_page [#943](https://github.com/Apipie/apipie-rails/pull/943) (Nathan Palmer)
|
14
|
+
* Update it.yml following latest en.yml [#942](https://github.com/Apipie/apipie-rails/pull/942) (Claudio Maradonna)
|
15
|
+
|
3
16
|
|
4
17
|
## [v1.4.2](https://github.com/Apipie/apipie-rails/tree/v1.4.2) (2024-07-20)
|
5
18
|
[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v1.4.1...v1.4.2)
|
data/README.md
CHANGED
@@ -1401,7 +1401,7 @@ param :product_id, :number, :desc => "Identifier of the product", :required => t
|
|
1401
1401
|
param :quantity, :number, :desc => "Number of products to order", :required => true
|
1402
1402
|
```
|
1403
1403
|
|
1404
|
-
DecimalValidator
|
1404
|
+
## DecimalValidator
|
1405
1405
|
|
1406
1406
|
Check if the parameter is a decimal number
|
1407
1407
|
|
@@ -1599,7 +1599,7 @@ default version is used instead.
|
|
1599
1599
|
# Markup
|
1600
1600
|
|
1601
1601
|
The default markup language is
|
1602
|
-
[RDoc](https://
|
1602
|
+
[RDoc](https://ruby.github.io/rdoc/RDoc/Markup.html). It can be changed
|
1603
1603
|
in the config file (`config.markup=`) to one of these:
|
1604
1604
|
|
1605
1605
|
Markdown
|
data/config/locales/it.yml
CHANGED
@@ -15,6 +15,7 @@ it:
|
|
15
15
|
required: richiesto
|
16
16
|
optional: opzionale
|
17
17
|
nil_allowed: consentito nil
|
18
|
+
blank_allowed: consentito vuoto
|
18
19
|
param_name: Nome parametro
|
19
20
|
params: Parametri
|
20
21
|
examples: Esempi
|
@@ -29,3 +30,12 @@ it:
|
|
29
30
|
api_documentation: Documentazione API
|
30
31
|
headers: Header
|
31
32
|
header_name: Nome Header
|
33
|
+
code: Codice
|
34
|
+
returns: Ritorno
|
35
|
+
deprecated: Deprecato
|
36
|
+
deprecation_details: Dettagli di deprecazione
|
37
|
+
deprecation:
|
38
|
+
attributes:
|
39
|
+
deprecated_in: Deprecato il
|
40
|
+
sunset_at: Rimozione il
|
41
|
+
info: Informazioni
|
data/lib/apipie/application.rb
CHANGED
@@ -271,10 +271,7 @@ module Apipie
|
|
271
271
|
.json_schema_for_method_response(method, return_code, allow_nulls)
|
272
272
|
end
|
273
273
|
|
274
|
-
|
275
|
-
Apipie::SwaggerGenerator
|
276
|
-
.json_schema_for_self_describing_class(cls, allow_nulls)
|
277
|
-
end
|
274
|
+
delegate :json_schema_for_self_describing_class, to: :'Apipie::SwaggerGenerator'
|
278
275
|
|
279
276
|
def to_swagger_json(version, resource_id, method_name, language, clear_warnings = false)
|
280
277
|
return unless valid_search_args?(version, resource_id, method_name)
|
@@ -380,7 +377,7 @@ module Apipie
|
|
380
377
|
|
381
378
|
# @deprecated Use {#get_resource_id} instead
|
382
379
|
def get_resource_name(klass)
|
383
|
-
ActiveSupport::Deprecation.warn(
|
380
|
+
ActiveSupport::Deprecation.new('2.0', 'apipie-rails').warn(
|
384
381
|
<<~HEREDOC
|
385
382
|
Apipie::Application.get_resource_name is deprecated.
|
386
383
|
Use `Apipie::Application.get_resource_id instead.
|
@@ -230,63 +230,61 @@ module Apipie
|
|
230
230
|
def _apipie_define_validators(description)
|
231
231
|
|
232
232
|
# [re]define method only if validation is turned on
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
_apipie_save_method_params(description.method, description.params)
|
238
|
-
|
239
|
-
unless instance_methods.include?(:apipie_validations)
|
240
|
-
define_method(:apipie_validations) do
|
241
|
-
method_params = self.class._apipie_get_method_params(action_name)
|
242
|
-
|
243
|
-
if Apipie.configuration.validate_presence?
|
244
|
-
Validator::BaseValidator.raise_if_missing_params do |missing|
|
245
|
-
method_params.each_value do |param|
|
246
|
-
# check if required parameters are present
|
247
|
-
missing << param if param.required && !params.key?(param.name)
|
248
|
-
end
|
249
|
-
end
|
250
|
-
end
|
233
|
+
return unless description && [true, :implicitly, :explicitly].include?(Apipie.configuration.validate)
|
234
|
+
|
235
|
+
_apipie_save_method_params(description.method, description.params)
|
251
236
|
|
252
|
-
|
237
|
+
unless instance_methods.include?(:apipie_validations)
|
238
|
+
define_method(:apipie_validations) do
|
239
|
+
method_params = self.class._apipie_get_method_params(action_name)
|
240
|
+
|
241
|
+
if Apipie.configuration.validate_presence?
|
242
|
+
Validator::BaseValidator.raise_if_missing_params do |missing|
|
253
243
|
method_params.each_value do |param|
|
254
|
-
#
|
255
|
-
param
|
244
|
+
# check if required parameters are present
|
245
|
+
missing << param if param.required && !params.key?(param.name)
|
256
246
|
end
|
257
247
|
end
|
248
|
+
end
|
258
249
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
params.
|
263
|
-
# params allowed
|
264
|
-
if method_params.none? {|_,p| p.name.to_s == param.to_s}
|
265
|
-
self.class._apipie_handle_validate_key_error params, param
|
266
|
-
end
|
267
|
-
end
|
250
|
+
if Apipie.configuration.validate_value?
|
251
|
+
method_params.each_value do |param|
|
252
|
+
# params validations
|
253
|
+
param.validate(params[:"#{param.name}"]) if params.key?(param.name)
|
268
254
|
end
|
255
|
+
end
|
269
256
|
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
257
|
+
# Only allow params passed in that are defined keys in the api
|
258
|
+
# Auto skip the default params (format, controller, action)
|
259
|
+
if Apipie.configuration.validate_key?
|
260
|
+
params.reject{|k,_| %w[format controller action].include?(k.to_s) }.each_pair do |param, _|
|
261
|
+
# params allowed
|
262
|
+
if method_params.none? {|_,p| p.name.to_s == param.to_s}
|
263
|
+
self.class._apipie_handle_validate_key_error params, param
|
264
|
+
end
|
275
265
|
end
|
276
266
|
end
|
267
|
+
|
268
|
+
return unless Apipie.configuration.process_value?
|
269
|
+
@api_params ||= {}
|
270
|
+
method_params.each_value do |param|
|
271
|
+
# params processing
|
272
|
+
@api_params[param.as] = param.process_value(params[:"#{param.name}"]) if params.key?(param.name)
|
273
|
+
end
|
277
274
|
end
|
275
|
+
end
|
278
276
|
|
279
|
-
|
280
|
-
|
277
|
+
return unless [:implicitly, true].include?(Apipie.configuration.validate)
|
278
|
+
old_method = instance_method(description.method)
|
281
279
|
|
282
|
-
|
283
|
-
|
280
|
+
define_method(description.method) do |*args|
|
281
|
+
apipie_validations
|
284
282
|
|
285
|
-
|
286
|
-
|
287
|
-
end
|
288
|
-
end
|
283
|
+
# run the original method code
|
284
|
+
old_method.bind(self).call(*args)
|
289
285
|
end
|
286
|
+
|
287
|
+
|
290
288
|
end
|
291
289
|
|
292
290
|
def _apipie_handle_validate_key_error params, param
|
@@ -18,6 +18,7 @@ module Apipie
|
|
18
18
|
|
19
19
|
def ignore_call?(record)
|
20
20
|
return true unless record[:controller]
|
21
|
+
return true unless record[:action]
|
21
22
|
return true if @ignored.include?(record[:controller].name)
|
22
23
|
return true if @ignored.include?("#{Apipie.get_resource_id(record[:controller].name)}##{record[:action]}")
|
23
24
|
return true unless @api_controllers_paths.include?(controller_full_path(record[:controller]))
|
data/lib/apipie/extractor.rb
CHANGED
@@ -17,7 +17,7 @@ module Apipie
|
|
17
17
|
CONFIG_ATTRIBUTES.each do |attribute|
|
18
18
|
old_setter_method = "swagger_#{attribute}="
|
19
19
|
define_method(old_setter_method) do |value|
|
20
|
-
ActiveSupport::Deprecation.warn(
|
20
|
+
ActiveSupport::Deprecation.new('2.0', 'apipie-rails').warn(
|
21
21
|
<<~HEREDOC
|
22
22
|
config.#{old_setter_method}#{value} is deprecated.
|
23
23
|
config.generator.swagger.#{attribute} instead.
|
@@ -29,7 +29,7 @@ module Apipie
|
|
29
29
|
|
30
30
|
old_setter_method = "swagger_#{attribute}"
|
31
31
|
define_method(old_setter_method) do
|
32
|
-
ActiveSupport::Deprecation.warn(
|
32
|
+
ActiveSupport::Deprecation.new('2.0', 'apipie-rails').warn(
|
33
33
|
<<~HEREDOC
|
34
34
|
config.#{old_setter_method} is deprecated.
|
35
35
|
Use config.generator.swagger.#{attribute} instead.
|
@@ -87,7 +87,7 @@ module Apipie
|
|
87
87
|
action_awareness
|
88
88
|
|
89
89
|
if validator
|
90
|
-
if (validator != Hash) && (validator.is_a? Hash) &&
|
90
|
+
if (validator != Hash) && (validator.is_a? Hash) && validator[:array_of]
|
91
91
|
@is_array = true
|
92
92
|
validator = validator[:array_of]
|
93
93
|
raise "an ':array_of =>' validator is allowed exclusively on response-only fields" unless @response_only
|
@@ -119,17 +119,13 @@ module Apipie
|
|
119
119
|
@is_array_of != false
|
120
120
|
end
|
121
121
|
|
122
|
-
|
123
|
-
@response_object.typename
|
124
|
-
end
|
122
|
+
delegate :typename, to: :@response_object
|
125
123
|
|
126
124
|
def param_description
|
127
125
|
nil
|
128
126
|
end
|
129
127
|
|
130
|
-
|
131
|
-
@response_object.params_ordered
|
132
|
-
end
|
128
|
+
delegate :params_ordered, to: :@response_object
|
133
129
|
|
134
130
|
def additional_properties
|
135
131
|
!!@response_object.additional_properties
|
data/lib/apipie/validator.rb
CHANGED
@@ -431,9 +431,7 @@ module Apipie
|
|
431
431
|
|
432
432
|
class DecimalValidator < BaseValidator
|
433
433
|
|
434
|
-
|
435
|
-
self.class.validate(value)
|
436
|
-
end
|
434
|
+
delegate :validate, to: :class
|
437
435
|
|
438
436
|
def self.build(param_description, argument, options, block)
|
439
437
|
if argument == :decimal
|
@@ -456,9 +454,7 @@ module Apipie
|
|
456
454
|
|
457
455
|
class NumberValidator < BaseValidator
|
458
456
|
|
459
|
-
|
460
|
-
self.class.validate(value)
|
461
|
-
end
|
457
|
+
delegate :validate, to: :class
|
462
458
|
|
463
459
|
def self.build(param_description, argument, options, block)
|
464
460
|
if argument == :number
|
@@ -549,9 +545,7 @@ module Apipie
|
|
549
545
|
"Must be an Array of nested elements"
|
550
546
|
end
|
551
547
|
|
552
|
-
|
553
|
-
@validator.params_ordered
|
554
|
-
end
|
548
|
+
delegate :params_ordered, to: :@validator
|
555
549
|
end
|
556
550
|
|
557
551
|
end
|
data/lib/apipie/version.rb
CHANGED
data/lib/tasks/apipie.rake
CHANGED
@@ -182,7 +182,7 @@ namespace :apipie do
|
|
182
182
|
return @apipie_renderer
|
183
183
|
end
|
184
184
|
|
185
|
-
def
|
185
|
+
def render_apipie_page(file_name, template, variables, layout = 'apipie')
|
186
186
|
av = renderer
|
187
187
|
File.open(file_name, "w") do |f|
|
188
188
|
variables.each do |var, val|
|
@@ -238,21 +238,21 @@ namespace :apipie do
|
|
238
238
|
def generate_one_page(file_base, doc, lang = nil)
|
239
239
|
FileUtils.mkdir_p(File.dirname(file_base)) unless File.exist?(File.dirname(file_base))
|
240
240
|
|
241
|
-
|
241
|
+
render_apipie_page("#{file_base}-onepage#{lang_ext(lang)}.html", "static", {:doc => doc[:docs],
|
242
242
|
:language => lang, :languages => Apipie.configuration.languages})
|
243
243
|
end
|
244
244
|
|
245
245
|
def generate_plain_page(file_base, doc, lang = nil)
|
246
246
|
FileUtils.mkdir_p(File.dirname(file_base)) unless File.exist?(File.dirname(file_base))
|
247
247
|
|
248
|
-
|
248
|
+
render_apipie_page("#{file_base}-plain#{lang_ext(lang)}.html", "plain", {:doc => doc[:docs],
|
249
249
|
:language => lang, :languages => Apipie.configuration.languages}, nil)
|
250
250
|
end
|
251
251
|
|
252
252
|
def generate_index_page(file_base, doc, include_json = false, show_versions = false, lang = nil)
|
253
253
|
FileUtils.mkdir_p(File.dirname(file_base)) unless File.exist?(File.dirname(file_base))
|
254
254
|
versions = show_versions && Apipie.available_versions
|
255
|
-
|
255
|
+
render_apipie_page("#{file_base}#{lang_ext(lang)}.html", "index", {:doc => doc[:docs],
|
256
256
|
:versions => versions, :language => lang, :languages => Apipie.configuration.languages})
|
257
257
|
|
258
258
|
File.open("#{file_base}#{lang_ext(lang)}.json", "w") { |f| f << doc.to_json } if include_json
|
@@ -265,7 +265,7 @@ namespace :apipie do
|
|
265
265
|
|
266
266
|
doc = Apipie.to_json(version, resource_id, nil, lang)
|
267
267
|
doc[:docs][:link_extension] = (lang ? ".#{lang}.html" : ".html")
|
268
|
-
|
268
|
+
render_apipie_page("#{resource_file_base}#{lang_ext(lang)}.html", "resource", {:doc => doc[:docs],
|
269
269
|
:resource => doc[:docs][:resources].first, :language => lang, :languages => Apipie.configuration.languages})
|
270
270
|
File.open("#{resource_file_base}#{lang_ext(lang)}.json", "w") { |f| f << doc.to_json } if include_json
|
271
271
|
end
|
@@ -279,7 +279,7 @@ namespace :apipie do
|
|
279
279
|
|
280
280
|
doc = Apipie.to_json(version, resource_id, method[:name], lang)
|
281
281
|
doc[:docs][:link_extension] = (lang ? ".#{lang}.html" : ".html")
|
282
|
-
|
282
|
+
render_apipie_page("#{method_file_base}#{lang_ext(lang)}.html", "method", {:doc => doc[:docs],
|
283
283
|
:resource => doc[:docs][:resources].first,
|
284
284
|
:method => doc[:docs][:resources].first[:methods].first,
|
285
285
|
:language => lang,
|
data/rel-eng/gem_release.ipynb
CHANGED
@@ -31,9 +31,25 @@
|
|
31
31
|
},
|
32
32
|
{
|
33
33
|
"cell_type": "code",
|
34
|
-
"execution_count":
|
35
|
-
"metadata": {},
|
36
|
-
"outputs": [
|
34
|
+
"execution_count": 5,
|
35
|
+
"metadata": {},
|
36
|
+
"outputs": [
|
37
|
+
{
|
38
|
+
"name": "stdout",
|
39
|
+
"output_type": "stream",
|
40
|
+
"text": [
|
41
|
+
"/home/evgeni/Devel/apipie/apipie-rails\n"
|
42
|
+
]
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"name": "stderr",
|
46
|
+
"output_type": "stream",
|
47
|
+
"text": [
|
48
|
+
"/usr/lib/python3.13/site-packages/IPython/core/magics/osm.py:417: UserWarning: This is now an optional IPython functionality, setting dhist requires you to install the `pickleshare` library.\n",
|
49
|
+
" self.shell.db['dhist'] = compress_dhist(dhist)[-100:]\n"
|
50
|
+
]
|
51
|
+
}
|
52
|
+
],
|
37
53
|
"source": [
|
38
54
|
"%cd .."
|
39
55
|
]
|
@@ -47,12 +63,12 @@
|
|
47
63
|
},
|
48
64
|
{
|
49
65
|
"cell_type": "code",
|
50
|
-
"execution_count":
|
66
|
+
"execution_count": 2,
|
51
67
|
"metadata": {},
|
52
68
|
"outputs": [],
|
53
69
|
"source": [
|
54
|
-
"NEW_VERSION = '
|
55
|
-
"LAST_VERSION = '
|
70
|
+
"NEW_VERSION = '1.5.0'\n",
|
71
|
+
"LAST_VERSION = '1.4.2'\n",
|
56
72
|
"GIT_REMOTE_UPSTREAM = 'origin'\n",
|
57
73
|
"STABLE_RELEASE = False\n",
|
58
74
|
"WORK_BRANCH = 'stable' if STABLE_RELEASE else 'master'\n",
|
@@ -149,7 +165,7 @@
|
|
149
165
|
},
|
150
166
|
{
|
151
167
|
"cell_type": "code",
|
152
|
-
"execution_count":
|
168
|
+
"execution_count": 7,
|
153
169
|
"metadata": {},
|
154
170
|
"outputs": [],
|
155
171
|
"source": [
|
@@ -158,9 +174,32 @@
|
|
158
174
|
},
|
159
175
|
{
|
160
176
|
"cell_type": "code",
|
161
|
-
"execution_count":
|
162
|
-
"metadata": {},
|
163
|
-
"outputs": [
|
177
|
+
"execution_count": 3,
|
178
|
+
"metadata": {},
|
179
|
+
"outputs": [
|
180
|
+
{
|
181
|
+
"data": {
|
182
|
+
"text/markdown": [
|
183
|
+
"* Don't collect records without an action (Evgeni Golov)\n",
|
184
|
+
"* Update test matrix: rails 7.2, 8.0, ruby 3.4 [#960](https://github.com/Apipie/apipie-rails/pull/960) (Evgeni Golov)\n",
|
185
|
+
"* Fix activesupport::deprecation.warn deprecation (Jonathan Biolaz)\n",
|
186
|
+
"* Rubocop autofix (Evgeni Golov)\n",
|
187
|
+
"* Update ci workflow to run on ubuntu 24.04 (Evgeni Golov)\n",
|
188
|
+
"* Fix issue with loading rails logger in tests (Eric Helms)\n",
|
189
|
+
"* Update link for rdoc in readme (Panos Dalitsouris)\n",
|
190
|
+
"* Fix the decimalvalidator header in readme.md [#945](https://github.com/Apipie/apipie-rails/pull/945) (Ewoud Kohl van Wijngaarden)\n",
|
191
|
+
"* Rename render_page in apipie.rake to render_apipie_page [#943](https://github.com/Apipie/apipie-rails/pull/943) (Nathan Palmer)\n",
|
192
|
+
"* Update it.yml following latest en.yml [#942](https://github.com/Apipie/apipie-rails/pull/942) (Claudio Maradonna)"
|
193
|
+
],
|
194
|
+
"text/plain": [
|
195
|
+
"<IPython.core.display.Markdown object>"
|
196
|
+
]
|
197
|
+
},
|
198
|
+
"execution_count": 3,
|
199
|
+
"metadata": {},
|
200
|
+
"output_type": "execute_result"
|
201
|
+
}
|
202
|
+
],
|
164
203
|
"source": [
|
165
204
|
"# Parse git changelog\n",
|
166
205
|
"from IPython.display import Markdown as md\n",
|
@@ -192,7 +231,7 @@
|
|
192
231
|
},
|
193
232
|
{
|
194
233
|
"cell_type": "code",
|
195
|
-
"execution_count":
|
234
|
+
"execution_count": 6,
|
196
235
|
"metadata": {},
|
197
236
|
"outputs": [],
|
198
237
|
"source": [
|
@@ -230,9 +269,7 @@
|
|
230
269
|
{
|
231
270
|
"cell_type": "code",
|
232
271
|
"execution_count": null,
|
233
|
-
"metadata": {
|
234
|
-
"scrolled": false
|
235
|
-
},
|
272
|
+
"metadata": {},
|
236
273
|
"outputs": [],
|
237
274
|
"source": [
|
238
275
|
"! git add -u\n",
|
@@ -355,9 +392,31 @@
|
|
355
392
|
},
|
356
393
|
{
|
357
394
|
"cell_type": "code",
|
358
|
-
"execution_count":
|
359
|
-
"metadata": {},
|
360
|
-
"outputs": [
|
395
|
+
"execution_count": 8,
|
396
|
+
"metadata": {},
|
397
|
+
"outputs": [
|
398
|
+
{
|
399
|
+
"name": "stdout",
|
400
|
+
"output_type": "stream",
|
401
|
+
"text": [
|
402
|
+
"\n",
|
403
|
+
"\n",
|
404
|
+
"* Don't collect records without an action (Evgeni Golov)\n",
|
405
|
+
"* Update test matrix: rails 7.2, 8.0, ruby 3.4 [#960](https://github.com/Apipie/apipie-rails/pull/960) (Evgeni Golov)\n",
|
406
|
+
"* Fix activesupport::deprecation.warn deprecation (Jonathan Biolaz)\n",
|
407
|
+
"* Rubocop autofix (Evgeni Golov)\n",
|
408
|
+
"* Update ci workflow to run on ubuntu 24.04 (Evgeni Golov)\n",
|
409
|
+
"* Fix issue with loading rails logger in tests (Eric Helms)\n",
|
410
|
+
"* Update link for rdoc in readme (Panos Dalitsouris)\n",
|
411
|
+
"* Fix the decimalvalidator header in readme.md [#945](https://github.com/Apipie/apipie-rails/pull/945) (Ewoud Kohl van Wijngaarden)\n",
|
412
|
+
"* Rename render_page in apipie.rake to render_apipie_page [#943](https://github.com/Apipie/apipie-rails/pull/943) (Nathan Palmer)\n",
|
413
|
+
"* Update it.yml following latest en.yml [#942](https://github.com/Apipie/apipie-rails/pull/942) (Claudio Maradonna)\n",
|
414
|
+
"\n",
|
415
|
+
"\n",
|
416
|
+
"https://github.com/Apipie/apipie-rails/releases/new?tag=1.5.0\n"
|
417
|
+
]
|
418
|
+
}
|
419
|
+
],
|
361
420
|
"source": [
|
362
421
|
"print('\\n')\n",
|
363
422
|
"print('\\n'.join(change_log))\n",
|
@@ -376,7 +435,7 @@
|
|
376
435
|
],
|
377
436
|
"metadata": {
|
378
437
|
"kernelspec": {
|
379
|
-
"display_name": "Python 3",
|
438
|
+
"display_name": "Python 3 (ipykernel)",
|
380
439
|
"language": "python",
|
381
440
|
"name": "python3"
|
382
441
|
},
|
@@ -390,9 +449,9 @@
|
|
390
449
|
"name": "python",
|
391
450
|
"nbconvert_exporter": "python",
|
392
451
|
"pygments_lexer": "ipython3",
|
393
|
-
"version": "3.6
|
452
|
+
"version": "3.13.6"
|
394
453
|
}
|
395
454
|
},
|
396
455
|
"nbformat": 4,
|
397
|
-
"nbformat_minor":
|
456
|
+
"nbformat_minor": 4
|
398
457
|
}
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -10,7 +10,13 @@ describe Apipie::Extractor::Collector do
|
|
10
10
|
|
11
11
|
let(:record) { { controller: controller, action: action } }
|
12
12
|
let(:controller) { ActionController::Base }
|
13
|
-
let(:action) {
|
13
|
+
let(:action) { 'index' }
|
14
|
+
|
15
|
+
context 'when action is nil' do
|
16
|
+
let(:action) { nil }
|
17
|
+
|
18
|
+
it { is_expected.to be true }
|
19
|
+
end
|
14
20
|
|
15
21
|
context 'when controller is nil' do
|
16
22
|
let(:controller) { nil }
|
data/spec/spec_helper.rb
CHANGED
@@ -38,7 +38,7 @@ RSpec::Matchers.define :have_field do |name, type, opts = {}|
|
|
38
38
|
|
39
39
|
match do |unresolved|
|
40
40
|
actual = resolve_refs(unresolved)
|
41
|
-
return fail("expected schema to have type 'object' (got '#{actual[:type]}')") if
|
41
|
+
return fail("expected schema to have type 'object' (got '#{actual[:type]}')") if actual[:type] != 'object'
|
42
42
|
return fail("expected schema to include param named '#{name}' (got #{actual[:properties].keys})") if (prop = actual[:properties][name]).nil?
|
43
43
|
return fail("expected param '#{name}' to have type '#{type}' (got '#{prop[:type]}')") if prop[:type] != type
|
44
44
|
return fail("expected param '#{name}' to have description '#{opts[:description]}' (got '#{prop[:description]}')") if opts[:description] && prop[:description] != opts[:description]
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apipie-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Pokorny
|
8
8
|
- Ivan Necas
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: actionpack
|
@@ -477,7 +476,6 @@ metadata:
|
|
477
476
|
bug_tracker_uri: https://github.com/Apipie/apipie-rails/issues
|
478
477
|
changelog_uri: https://github.com/Apipie/apipie-rails/blob/master/CHANGELOG.md
|
479
478
|
source_code_uri: https://github.com/Apipie/apipie-rails
|
480
|
-
post_install_message:
|
481
479
|
rdoc_options: []
|
482
480
|
require_paths:
|
483
481
|
- lib
|
@@ -492,8 +490,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
492
490
|
- !ruby/object:Gem::Version
|
493
491
|
version: '0'
|
494
492
|
requirements: []
|
495
|
-
rubygems_version: 3.
|
496
|
-
signing_key:
|
493
|
+
rubygems_version: 3.6.7
|
497
494
|
specification_version: 4
|
498
495
|
summary: Rails REST API documentation tool
|
499
496
|
test_files:
|