api-regulator 0.1.23 → 0.1.25

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2954fc88571b8b3d2086405b0b6973f0202debe1284408531b4a079ba9d86c9c
4
- data.tar.gz: 0267527b762872e05fe3a84d7145e39958f4616240dc590d3e10f3996650d387
3
+ metadata.gz: 4bfac01d6824d8766853d5828ea9f0eddd0e72dd76fb6b97c7bf3927803f7df1
4
+ data.tar.gz: 87cb03abe3c0b824fd60192cae2a2e91d856b2781a07e6db17ff6de087e6d81d
5
5
  SHA512:
6
- metadata.gz: '06548a9e1bce09a019c2c0e105e3bf34aeabd737dc5f4f802ae3903c0dc0eaae3dfaf841d75d1624948dfc90f465909d6807764a83d6a70c9b9b4922c2c828a9'
7
- data.tar.gz: d6a151ef312d62ab88bddc1875645fac23945ed37b5afc0fecb8494700e1443849f38172c89c94434c3ecacb413391078bdffd9e2177417bd629cc02559e1c9f
6
+ metadata.gz: cb4c663aa47979a8199ecd58acd61676f266dd6cb03beed0158a6bc5a9060c8f5af19ce08821533627c9bce2ae6409a0be23ce820a0d11c2c242195b531d59c8
7
+ data.tar.gz: d75f1bfe1f0f045868fedc9782fabb57825d3815e85572bc0be24c3f62eab5d2db868710a73206a138b8f334477792fdd2cbc92ad74646bd8d0c205e71a15fdc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api-regulator (0.1.23)
4
+ api-regulator (0.1.25)
5
5
  activemodel (~> 8.0)
6
6
  activesupport (~> 8.0)
7
7
 
@@ -135,7 +135,7 @@ GEM
135
135
  date
136
136
  stringio
137
137
  racc (1.8.1)
138
- rack (3.1.10)
138
+ rack (3.1.11)
139
139
  rack-session (2.1.0)
140
140
  base64 (>= 0.1.0)
141
141
  rack (>= 3.0.0)
@@ -72,6 +72,10 @@ module ApiRegulator
72
72
  params.map do |param|
73
73
  if param.children.any?
74
74
  { param.name.to_sym => build_permitted_keys(param.children) }
75
+ elsif param.type == :array
76
+ { param.name.to_sym => [] }
77
+ elsif param.type == :object
78
+ { param.name.to_sym => {} }
75
79
  else
76
80
  param.name.to_sym
77
81
  end
@@ -104,7 +104,9 @@ module ApiRegulator
104
104
  end
105
105
 
106
106
  # Store the nested class under the parent class namespace
107
- parent_class.const_set(class_name, nested_validator_class)
107
+ silence_warnings do
108
+ parent_class.const_set(class_name, nested_validator_class)
109
+ end
108
110
  nested_validator_class
109
111
  end
110
112
  end
@@ -251,7 +253,9 @@ module ApiRegulator
251
253
  api_definitions.each do |api_definition|
252
254
  class_name = build_class_name(api_definition.controller_path, api_definition.action_name)
253
255
  validator_class = build_class(api_definition.params, api_definition.action_name)
254
- Validator.const_set(class_name, validator_class)
256
+ silence_warnings do
257
+ Validator.const_set(class_name, validator_class)
258
+ end
255
259
  end
256
260
  end
257
261
 
@@ -260,7 +264,9 @@ module ApiRegulator
260
264
  api_definition.responses.each do |code, params|
261
265
  class_name = build_class_name(api_definition.controller_path, api_definition.action_name, code)
262
266
  validator_class = build_class(params.children, api_definition.action_name)
263
- Validator.const_set(class_name, validator_class)
267
+ silence_warnings do
268
+ Validator.const_set(class_name, validator_class)
269
+ end
264
270
  end
265
271
  end
266
272
  end
@@ -1,3 +1,3 @@
1
1
  module ApiRegulator
2
- VERSION = "0.1.23"
2
+ VERSION = "0.1.25"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-regulator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Massanek
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-26 00:00:00.000000000 Z
11
+ date: 2025-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport