ree_lib 1.0.38 → 1.0.39
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: 941b77c681e1913693fd1d61bbdb31f80a58a28c57d0449572326c00168d08f5
|
4
|
+
data.tar.gz: 618a3a1cb779993f53b089b53c701da7152bbc668a0e482687e44fbb5527ac57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62b8cd78d133570a809a7c7c1ecec96223f9b92ffe018fb126891b016ede11f02d2efda8d50fea34323679d621544a83422100bf075e17fe97a6360c297fd2dd
|
7
|
+
data.tar.gz: 321b3a88a7d74b08bd5c9ebfc7820916fede0d196c0687615033fb4d8e08b198c013502fb8b88ae131ee963f578315986c12c779b782a38e7fb6d7d242c2fb9a
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
RSpec.describe :register_type do
|
2
2
|
link :build_mapper_factory, from: :ree_mapper
|
3
3
|
link :build_mapper_strategy, from: :ree_mapper
|
4
|
+
link :build_request_body_schema, from: :ree_swagger
|
4
5
|
link :build_serializer_schema, from: :ree_swagger
|
5
6
|
link :register_type, from: :ree_swagger
|
6
7
|
|
@@ -8,11 +9,16 @@ RSpec.describe :register_type do
|
|
8
9
|
def serialize(obj, role: nil)
|
9
10
|
obj.inspect
|
10
11
|
end
|
12
|
+
|
13
|
+
def cast(obj, **)
|
14
|
+
obj
|
15
|
+
end
|
11
16
|
end
|
12
17
|
|
13
18
|
let(:mapper_factory) {
|
14
19
|
strategies = [
|
15
20
|
build_mapper_strategy(method: :serialize, dto: Hash),
|
21
|
+
build_mapper_strategy(method: :cast, dto: Hash),
|
16
22
|
]
|
17
23
|
|
18
24
|
build_mapper_factory(strategies: strategies)
|
@@ -20,8 +26,9 @@ RSpec.describe :register_type do
|
|
20
26
|
}
|
21
27
|
|
22
28
|
let(:mapper) {
|
23
|
-
mapper_factory.call.use(:serialize) do
|
29
|
+
mapper_factory.call.use(:serialize).use(:cast) do
|
24
30
|
my_type :name
|
31
|
+
array :ids, integer
|
25
32
|
end
|
26
33
|
}
|
27
34
|
|
@@ -35,6 +42,16 @@ RSpec.describe :register_type do
|
|
35
42
|
}
|
36
43
|
}
|
37
44
|
)
|
45
|
+
|
46
|
+
register_type(
|
47
|
+
:casters,
|
48
|
+
ReeSwagger::MyType,
|
49
|
+
->(my_type, build_serializer_schema) {
|
50
|
+
{
|
51
|
+
type: 'string'
|
52
|
+
}
|
53
|
+
}
|
54
|
+
)
|
38
55
|
end
|
39
56
|
|
40
57
|
it {
|
@@ -44,7 +61,23 @@ RSpec.describe :register_type do
|
|
44
61
|
properties: {
|
45
62
|
name: {
|
46
63
|
type: 'string'
|
47
|
-
}
|
64
|
+
},
|
65
|
+
ids: { items: { type: "integer" }, type: "array" }
|
66
|
+
}
|
67
|
+
}
|
68
|
+
)
|
69
|
+
}
|
70
|
+
|
71
|
+
it {
|
72
|
+
expect(build_request_body_schema(mapper)).to eq(
|
73
|
+
{
|
74
|
+
type: 'object',
|
75
|
+
required: ["name", "ids"],
|
76
|
+
properties: {
|
77
|
+
name: {
|
78
|
+
type: 'string'
|
79
|
+
},
|
80
|
+
ids: { items: { type: "integer" }, type: "array" }
|
48
81
|
}
|
49
82
|
}
|
50
83
|
)
|
data/lib/ree_lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ree_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruslan Gatiyatov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ree
|