smart_schema 0.12.0 → 0.12.2
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/CHANGELOG.md +27 -0
- data/Gemfile.lock +3 -3
- data/lib/smart_core/schema/checker/rules/base.rb +2 -2
- data/lib/smart_core/schema/plugins/dry_types/dry_types/abstract_factory.rb +9 -1
- data/lib/smart_core/schema/type_system/interop/abstract_factory.rb +12 -0
- data/lib/smart_core/schema/type_system/interop.rb +8 -0
- data/lib/smart_core/schema/type_system/smart_types/abstract_factory.rb +8 -0
- data/lib/smart_core/schema/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1baeb9efbe28675cb34582cba0f687b6a70bf05c4864e8d5e94517276536efc5
|
|
4
|
+
data.tar.gz: de5f2789d69a4a16fc93cbbee9caa71c9f1a21779efe3fafcca69edbd3f7d4f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79b8b451be28bfa26c0cba74d4fbf0508a8f380aaeb26a4483f034b34cad15aaf7151349c5154d48e18d4dcdedbc41887d4c62ebd5c3b2cb8c614af78e40152a
|
|
7
|
+
data.tar.gz: 9da91cb3e55e452721c602ab0e6cc22c0f4cc1af6a79b7a1a736401cfd7ab7ff536b38b9040a0b7da7f10f22b8916f6e97aa606fb7736739266290e700e7fd1a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
# [0.12.2] - 2026-02-18
|
|
5
|
+
- Empty release for the gem republishing;
|
|
6
|
+
|
|
7
|
+
# [0.12.1] - 2026-02-18
|
|
8
|
+
## Fixed
|
|
9
|
+
- Nested schemas requires :hash type for their schema key, but
|
|
10
|
+
this type is resolved from the type alias, not from the type object.
|
|
11
|
+
- Added an object reference to the hash primitive in `type interop` subsystem (interop + abstract factory);
|
|
12
|
+
- each type system should provide hash type class:
|
|
13
|
+
- smart-core provides/recognizes nested structures with `SmartCore::Types::Hash`;
|
|
14
|
+
- dry-types provides/recognizes nested structures with `Dry::Types['hash']`;
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
# before:
|
|
18
|
+
|
|
19
|
+
require 'dry-types'
|
|
20
|
+
SmartCore::Schema::Configuration.configure { |c| c.type_system = :dry_types }
|
|
21
|
+
|
|
22
|
+
class MySchema < SmartCore::Schema
|
|
23
|
+
schema do
|
|
24
|
+
requried(:some_data) do # <- previously: failed on unrecognized type with :hash alias
|
|
25
|
+
requireqd(:some_key).type(Dry::Types['string'])
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
```
|
|
30
|
+
|
|
4
31
|
# [0.12.0] - 2026-02-17
|
|
5
32
|
## Added
|
|
6
33
|
- Plugin ecosystem;
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
smart_schema (0.12.
|
|
4
|
+
smart_schema (0.12.2)
|
|
5
5
|
qonfig (~> 0.30)
|
|
6
6
|
smart_engine (~> 0.17)
|
|
7
7
|
smart_types (~> 0.8)
|
|
@@ -184,7 +184,7 @@ PLATFORMS
|
|
|
184
184
|
DEPENDENCIES
|
|
185
185
|
armitage-rubocop (~> 1.81)
|
|
186
186
|
bundler
|
|
187
|
-
dry-types
|
|
187
|
+
dry-types (~> 1.9)
|
|
188
188
|
pry (~> 0.16)
|
|
189
189
|
pry-doc (~> 1.7)
|
|
190
190
|
rake (~> 13.3)
|
|
@@ -251,7 +251,7 @@ CHECKSUMS
|
|
|
251
251
|
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
|
|
252
252
|
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
|
|
253
253
|
smart_engine (0.17.0) sha256=33321745063737a9262f53ef7b5b040d65f8d8f5a5230ac6d3c2461b0404a52b
|
|
254
|
-
smart_schema (0.12.
|
|
254
|
+
smart_schema (0.12.2)
|
|
255
255
|
smart_types (0.8.0) sha256=87879face377e4738e887f4b34657f8ed9572b8d22bd2deb6028bb45261a5bb7
|
|
256
256
|
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
|
|
257
257
|
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
|
|
@@ -95,7 +95,7 @@ class SmartCore::Schema::Checker::Rules::Base
|
|
|
95
95
|
#
|
|
96
96
|
# @api private
|
|
97
97
|
# @since 0.1.0
|
|
98
|
-
# @version 0.
|
|
98
|
+
# @version 0.12.1
|
|
99
99
|
def define_nested_reconciler(&nested_definitions)
|
|
100
100
|
return unless block_given?
|
|
101
101
|
|
|
@@ -105,6 +105,6 @@ class SmartCore::Schema::Checker::Rules::Base
|
|
|
105
105
|
constructor.append_definitions(@nested_reconciler, &nested_definitions)
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
-
type(
|
|
108
|
+
type(SmartCore::Schema.type_system.hash_type_object_for_nested_schemas).filled
|
|
109
109
|
end
|
|
110
110
|
end
|
|
@@ -48,7 +48,7 @@ module SmartCore::Schema::TypeSystem
|
|
|
48
48
|
::Dry::Types::Any
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
# @return [
|
|
51
|
+
# @return [Class<::Dry::Types::Type>]
|
|
52
52
|
#
|
|
53
53
|
# @api private
|
|
54
54
|
# @since 0.12.0
|
|
@@ -56,6 +56,14 @@ module SmartCore::Schema::TypeSystem
|
|
|
56
56
|
::Dry::Types::Type
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
# @return [::Dry::Types::Type]
|
|
60
|
+
#
|
|
61
|
+
# @api private
|
|
62
|
+
# @since 0.12.1
|
|
63
|
+
def hash_type_object_for_nested_schemas
|
|
64
|
+
::Dry::Types['hash']
|
|
65
|
+
end
|
|
66
|
+
|
|
59
67
|
# @param type [::Dry::Types::Type]
|
|
60
68
|
# @return [SmartCore::Schema::TypeSystem::DryTypes::Operation::Validate]
|
|
61
69
|
#
|
|
@@ -43,6 +43,18 @@ class SmartCore::Schema::TypeSystem::Interop::AbstractFactory
|
|
|
43
43
|
# @since 0.12.0
|
|
44
44
|
def prevent_incompatible_type!(type); end
|
|
45
45
|
|
|
46
|
+
# @return [Class]
|
|
47
|
+
#
|
|
48
|
+
# @api private
|
|
49
|
+
# @since 0.12.1
|
|
50
|
+
def primitive_type_class; end
|
|
51
|
+
|
|
52
|
+
# @return [Any]
|
|
53
|
+
#
|
|
54
|
+
# @api private
|
|
55
|
+
# @since 0.12.1
|
|
56
|
+
def hash_type_object_for_nested_schemas; end
|
|
57
|
+
|
|
46
58
|
private
|
|
47
59
|
|
|
48
60
|
# @param type [Any]
|
|
@@ -47,6 +47,14 @@ class SmartCore::Schema::TypeSystem::Interop
|
|
|
47
47
|
def primitive_type_class
|
|
48
48
|
self::AbstractFactory.primitive_type_class
|
|
49
49
|
end
|
|
50
|
+
|
|
51
|
+
# @return [Any]
|
|
52
|
+
#
|
|
53
|
+
# @api private
|
|
54
|
+
# @since 0.12.1
|
|
55
|
+
def hash_type_object_for_nested_schemas
|
|
56
|
+
self::AbstractFactory.hash_type_object_for_nested_schemas
|
|
57
|
+
end
|
|
50
58
|
end
|
|
51
59
|
|
|
52
60
|
# @return [String]
|
|
@@ -56,6 +56,14 @@ module SmartCore::Schema::TypeSystem
|
|
|
56
56
|
SmartCore::Types::Primitive
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
# @return [SmartCore::Types::Value::Hash]
|
|
60
|
+
#
|
|
61
|
+
# @api private
|
|
62
|
+
# @since 0.12.1
|
|
63
|
+
def hash_type_object_for_nested_schemas
|
|
64
|
+
SmartCore::Types::Value::Hash
|
|
65
|
+
end
|
|
66
|
+
|
|
59
67
|
# @param type [SmartCore::Types::Primitive]
|
|
60
68
|
# @return [SmartCore::Schema::TypeSystem::SmartTypes::Operation::Validate]
|
|
61
69
|
#
|