rails-param-validation 0.4.2 → 0.4.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: 93474c2cebc9d9ea2ee438a37054a775bf70bd66af809b6b6ebecd1213b29d24
|
4
|
+
data.tar.gz: 3354b776b3f8e9d63551ed1d6e51c350a52eb9aef68eedbcdd5437ab570520de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbf491a6d35b6c7bd6a230aabd4662e66ed40a522020ad55214fa1ef41909103f7e007e12f6aca01b27d0890684762305a6bab419662920ed5af109c5a998487
|
7
|
+
data.tar.gz: 9019f5b9aa9c753ae3de87a81a88ce5b2a74401ef9fde6b67708b2b24f5eb50b386641b9b6d95d0cfe21c5d0626b3b16673d996a4aa4f00df46d9e847f998c49
|
@@ -31,6 +31,7 @@ module RailsParamValidation
|
|
31
31
|
attr_accessor :default_body_content_type
|
32
32
|
attr_accessor :default_action_flags
|
33
33
|
attr_accessor :post_action_definition_hook
|
34
|
+
attr_accessor :auto_include_in_classes
|
34
35
|
attr_reader :openapi
|
35
36
|
|
36
37
|
def initialize
|
@@ -41,6 +42,7 @@ module RailsParamValidation
|
|
41
42
|
@default_body_content_type = 'application/json'
|
42
43
|
@default_action_flags = {}
|
43
44
|
@post_action_definition_hook = ->(_action_definition) {}
|
45
|
+
@auto_include_in_classes = %w[ActionController::Base ActionController::API]
|
44
46
|
end
|
45
47
|
end
|
46
48
|
|
@@ -17,15 +17,14 @@ module RailsParamValidation
|
|
17
17
|
|
18
18
|
initializer 'rails_param_validation.action_controller_extension' do
|
19
19
|
ActiveSupport.on_load(:action_controller) do
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
ActionController::API.send :extend, RailsParamValidation::Types
|
20
|
+
RailsParamValidation.config.auto_include_in_classes.each do |klass_name|
|
21
|
+
klass = klass_name.constantize
|
22
|
+
|
23
|
+
klass.send :include, ActionControllerExtension
|
24
|
+
klass.send :include, AnnotationExtension
|
25
|
+
klass.send :include, CustomTypesExtension
|
26
|
+
klass.send :extend, RailsParamValidation::Types
|
27
|
+
end
|
29
28
|
end
|
30
29
|
end
|
31
30
|
|
@@ -6,11 +6,6 @@ module RailsParamValidation
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def matches?(path, data)
|
9
|
-
if schema.schema.is_a? NilClass
|
10
|
-
puts path
|
11
|
-
puts schema.inspect
|
12
|
-
end
|
13
|
-
|
14
9
|
ValidatorFactory.create(schema.schema).matches? path, data
|
15
10
|
end
|
16
11
|
|
@@ -29,4 +24,4 @@ module RailsParamValidation
|
|
29
24
|
end
|
30
25
|
end
|
31
26
|
|
32
|
-
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-param-validation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oskar Kirmis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Declarative parameter definition and validation for Rails
|
14
14
|
email:
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
|
-
rubygems_version: 3.
|
96
|
+
rubygems_version: 3.0.2
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: Declarative parameter definition and validation for Rails
|