servactory 2.14.1 → 2.15.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.
@@ -29,7 +29,8 @@ module Servactory
29
29
  common_condition_with(attribute: output, value:, option:)
30
30
  end
31
31
 
32
- def common_condition_with(attribute:, value:, option:) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
32
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
33
+ def common_condition_with(attribute:, value:, option:)
33
34
  return true if option.value == false
34
35
  return [false, :wrong_type] unless @default_hash_mode_class_names.intersect?(attribute.types)
35
36
 
@@ -39,12 +40,17 @@ module Servactory
39
40
 
40
41
  schema = option.value.fetch(:is, option.value)
41
42
 
43
+ if attribute.internal? || attribute.output?
44
+ schema = schema.transform_values { |options| options.except(:prepare) }
45
+ end
46
+
42
47
  is_success, reason, meta = validate_for!(object: value, schema:)
43
48
 
44
49
  prepare_object_with!(object: value, schema:) if is_success
45
50
 
46
51
  [is_success, reason, meta]
47
52
  end
53
+ # rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
48
54
 
49
55
  def validate_for!(object:, schema:, root_schema_key: nil) # rubocop:disable Metrics/MethodLength
50
56
  unless object.respond_to?(:fetch)
@@ -3,8 +3,8 @@
3
3
  module Servactory
4
4
  module VERSION
5
5
  MAJOR = 2
6
- MINOR = 14
7
- PATCH = 1
6
+ MINOR = 15
7
+ PATCH = 0
8
8
  PRE = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: servactory
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.1
4
+ version: 2.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Sokolov