paradocs 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paradocs/field_dsl.rb +8 -0
- data/lib/paradocs/version.rb +1 -1
- data/spec/extensions/structures_spec.rb +9 -5
- data/spec/field_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: add6d55cad7f9a56bb95f6efe094afa0d9009109
|
4
|
+
data.tar.gz: 8c52dfc657dfb97a301f31567327e66c0dae9577
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c042f2d0738aee92991e86fc8a98df7649c6a0bf6c383e50c0f8e69e1237293950aad9fd7aef6b61bfef76ed2348ae6631161c20ce2f44995c23b4bd65cbd444
|
7
|
+
data.tar.gz: 3b9ae5c9de08aa07caa7b77a0064151c221d6bfe76b1c3b62e063963ec39028dd76426744b10286ce713c68818395c466686b1111551b1c0caf7ddd497a421ee
|
data/lib/paradocs/field_dsl.rb
CHANGED
data/lib/paradocs/version.rb
CHANGED
@@ -19,7 +19,7 @@ describe Paradocs::Extensions::Structure do
|
|
19
19
|
|
20
20
|
field(:data).type(:object).present.schema do
|
21
21
|
field(:id).type(:integer).present.policy(:policy_with_error)
|
22
|
-
field(:name).type(:string).meta(label: "very important staff")
|
22
|
+
field(:name).type(:string).meta(label: "very important staff").description("Example description").example("John")
|
23
23
|
field(:role).type(:string).declared.options(["admin", "user"]).default("user").mutates_schema! do |*|
|
24
24
|
:test_subschema
|
25
25
|
end
|
@@ -75,6 +75,8 @@ describe Paradocs::Extensions::Structure do
|
|
75
75
|
expect(data_structure[:name]).to eq({
|
76
76
|
type: :string,
|
77
77
|
label: "very important staff",
|
78
|
+
description: "Example description",
|
79
|
+
example: "John",
|
78
80
|
mutates_schema: true,
|
79
81
|
block_works: true,
|
80
82
|
json_path: "$.data.name",
|
@@ -140,6 +142,8 @@ describe Paradocs::Extensions::Structure do
|
|
140
142
|
type: :string,
|
141
143
|
json_path: "$.data.name",
|
142
144
|
label: "very important staff",
|
145
|
+
description: "Example description",
|
146
|
+
example: "John",
|
143
147
|
mutates_schema: true
|
144
148
|
},
|
145
149
|
"data.role" => {
|
@@ -177,7 +181,7 @@ describe Paradocs::Extensions::Structure do
|
|
177
181
|
_errors: [ArgumentError],
|
178
182
|
"data" => {type: :object, required: true, present: true, json_path: "$.data"},
|
179
183
|
"data.id" => {type: :integer, required: true, present: true, policy_with_error: {errors: [ArgumentError]}, json_path: "$.data.id"},
|
180
|
-
"data.name" => {type: :string, label: "very important staff", json_path: "$.data.name", mutates_schema: true},
|
184
|
+
"data.name" => {type: :string, label: "very important staff", json_path: "$.data.name", mutates_schema: true, description: "Example description", example: "John"},
|
181
185
|
"data.role" => {type: :string, options: ["admin", "user"], default: "user", json_path: "$.data.role", mutates_schema: true},
|
182
186
|
"data.extra" => {type: :array, required: true, json_path: "$.data.extra[]"},
|
183
187
|
"data.extra.extra" => {default: false, policy_with_silent_error: {errors: []}, json_path: "$.data.extra[].extra"},
|
@@ -187,7 +191,7 @@ describe Paradocs::Extensions::Structure do
|
|
187
191
|
_errors: [ArgumentError],
|
188
192
|
"data" => {type: :object, required: true, present: true, json_path: "$.data"},
|
189
193
|
"data.id" => {type: :integer, required: true, present: true, policy_with_error: {errors: [ArgumentError]}, json_path: "$.data.id"},
|
190
|
-
"data.name" => {type: :string, label: "very important staff", json_path: "$.data.name", mutates_schema: true},
|
194
|
+
"data.name" => {type: :string, label: "very important staff", json_path: "$.data.name", mutates_schema: true, description: "Example description", example: "John"},
|
191
195
|
"data.role" => {type: :string, options: ["admin", "user"], default: "user", json_path: "$.data.role", mutates_schema: true},
|
192
196
|
"data.extra" => {type: :array, required: true, json_path: "$.data.extra[]"},
|
193
197
|
"data.extra.extra" => {default: false, policy_with_silent_error: {errors: []}, json_path: "$.data.extra[].extra"},
|
@@ -212,7 +216,7 @@ describe Paradocs::Extensions::Structure do
|
|
212
216
|
"role" => {type: :string, options: ["admin", "user"], default: "user", json_path: "$.data.role", nested_name: "data.role", mutates_schema: true},
|
213
217
|
"test_field" => {required: true, present: true, json_path: "$.data.test_field", nested_name: "data.test_field"},
|
214
218
|
"id" => {type: :integer, required: true, present: true, policy_with_error: {errors: [ArgumentError]}, json_path: "$.data.id", nested_name: "data.id"},
|
215
|
-
"name" => {type: :string, label: "very important staff", json_path: "$.data.name", mutates_schema: true, nested_name: "data.name"},
|
219
|
+
"name" => {type: :string, label: "very important staff", json_path: "$.data.name", mutates_schema: true, nested_name: "data.name", description: "Example description", example: "John"},
|
216
220
|
"extra" => {
|
217
221
|
type: :array, required: true, json_path: "$.data.extra[]", nested_name: "data.extra",
|
218
222
|
structure: {"extra" => {default: false, policy_with_silent_error: {errors: []}, json_path: "$.data.extra[].extra", nested_name: "data.extra.extra"}}
|
@@ -232,7 +236,7 @@ describe Paradocs::Extensions::Structure do
|
|
232
236
|
"role" => {type: :string, options: ["admin", "user"], default: "user", json_path: "$.data.role", nested_name: "data.role", mutates_schema: true},
|
233
237
|
"test1" => {required: true, present: true, json_path: "$.data.test1", nested_name: "data.test1"},
|
234
238
|
"id" => {type: :integer, required: true, present: true, policy_with_error: {errors: [ArgumentError]}, json_path: "$.data.id", nested_name: "data.id"},
|
235
|
-
"name" => {type: :string, label: "very important staff", json_path: "$.data.name", mutates_schema: true, nested_name: "data.name"},
|
239
|
+
"name" => {type: :string, label: "very important staff", json_path: "$.data.name", mutates_schema: true, nested_name: "data.name", description: "Example description", example: "John"},
|
236
240
|
"extra" => {
|
237
241
|
type: :array, required: true, json_path: "$.data.extra[]", nested_name: "data.extra",
|
238
242
|
structure: {"extra" => {default: false, policy_with_silent_error: {errors: []}, json_path: "$.data.extra[].extra", nested_name: "data.extra.extra"}}}
|
data/spec/field_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paradocs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Tkachenko
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-10-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|