rails-param-validation 0.4.12 → 0.4.14

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: 61bc0afb5dba4401d6afa3f851416b53bed20ebde9c62fd89493da840fd82157
4
- data.tar.gz: a517bcab6f56b5e1c70884f126dcd91170b34bd503705ad8003c335a44ae5b7f
3
+ metadata.gz: a3eae277f67629481d14b7c25d6a8d6883b194f0e8a28df8b1dab38854e60b82
4
+ data.tar.gz: a56276914e1d304238a6de444ec80d8cdfbacb29d00c64746fd2ce88fcc665b3
5
5
  SHA512:
6
- metadata.gz: e8dc19eedd724d32b5bded8f7c01db9650fdc811fa4491d3e5fd89fed82fe9ea7fa7e073e0821ad3ac8c7c54b4f260032727c8547ffba53eed694c2214ccbb3b
7
- data.tar.gz: 82a35745f21469296d35073f82a5858a3dbbf0d524710457a20bb6e2d8f0711e9cc1f6d85ffb837af693747f395da635adff4cc0e0ea0da8129cf57a9c577478
6
+ metadata.gz: f3629891ba43c919f837b234d0d4133983a43eca0cc0ce8609747624920dcac443ebc9c14acc5c583468493eb189735b5e1fef8fefe4ba0f936e8d011c647246
7
+ data.tar.gz: 832116a057c74a7259fb7aae6e00ae777f9525102be9de6ef4074957969ccd1834ebd5253763d19d528e7b3faffadfc14ba0c844e1fd55f4202d3ae0db1e987d
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # RailsParamValidation
2
2
 
3
- [![pipeline status](https://git.iftrue.de/okirmis/rails-param-validation/badges/master/pipeline.svg)](https://git.iftrue.de/okirmis/rails-param-validation/commits/master)
4
-
5
3
  This gem provides parameter validation for Rails using a declarative parameter definition and makes the automatic validation of complex parameters very easy. It also supports an export of the definition as an OpenAPI document.
6
4
 
7
5
  * [Why this gem?](./docs/main-idea.md)
@@ -54,6 +54,16 @@ module RailsParamValidation
54
54
  end
55
55
 
56
56
  def add_response(status, schema, description)
57
+ if @responses.key?(status)
58
+ if @responses[status][:schema].is_a?(Array)
59
+ schema = @responses[status][:schema] + [schema];
60
+ else
61
+ schema = [@responses[status][:schema], schema]
62
+ end
63
+
64
+ description = @responses[status][:description] + "<br />&nbsp;<br />OR<br />&nbsp;<br />" + description
65
+ end
66
+
57
67
  @responses[status] = {
58
68
  schema: schema,
59
69
  description: description
@@ -20,7 +20,7 @@ module RailsParamValidation
20
20
 
21
21
  # Verify each entry
22
22
  data.each do |key, entry|
23
- match_key = @value_validator.matches?(path + ["#{key}[key]"], key)
23
+ match_key = @key_validator.matches?(path + ["#{key}[key]"], key)
24
24
  match_value = @value_validator.matches?(path + [key], entry)
25
25
 
26
26
  if match_value.matches? && match_key.matches?
@@ -1,3 +1,3 @@
1
1
  module RailsParamValidation
2
- VERSION = "0.4.12"
2
+ VERSION = "0.4.14"
3
3
  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.12
4
+ version: 0.4.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oskar Kirmis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-06 00:00:00.000000000 Z
11
+ date: 2023-05-25 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.3.13
96
+ rubygems_version: 3.4.12
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Declarative parameter definition and validation for Rails