deep_unrest 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/deep_unrest/application_controller.rb +1 -0
- data/lib/deep_unrest/version.rb +1 -1
- data/lib/deep_unrest.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7aa10e14eae9acbd80c7b653ab286dda09d01e1
|
4
|
+
data.tar.gz: 1ff8baa779ad96b4a48da949a8e0ad8dd4e7f996
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e29892394513884320436f1020669c5d89a8093a7385ce80e32212db274763726131dacbc2a017994f93187fe07acf8b73909094547c9b623dfeac4201dab407
|
7
|
+
data.tar.gz: 0ed4965e04a9810e851f5e22d62299705172b3f336b1508f3cd21b7315bc4d8541967ce9266fda264f166dd4e9a5617432f91ff890b859036cb1723fecc27067
|
data/lib/deep_unrest/version.rb
CHANGED
data/lib/deep_unrest.rb
CHANGED
@@ -162,6 +162,7 @@ module DeepUnrest
|
|
162
162
|
scope_type: scope_type,
|
163
163
|
scope: scope,
|
164
164
|
klass: to_class(type),
|
165
|
+
error_path: operation[:errorPath],
|
165
166
|
id: id }
|
166
167
|
|
167
168
|
context[:path] = operation[:path] unless scope_type == :show
|
@@ -348,9 +349,10 @@ module DeepUnrest
|
|
348
349
|
def self.format_errors(operation, path_info, values)
|
349
350
|
if operation
|
350
351
|
return values.map do |msg|
|
352
|
+
base_path = operation[:error_path] || operation[:path]
|
351
353
|
{ title: "#{path_info[:field].humanize} #{msg}",
|
352
354
|
detail: msg,
|
353
|
-
source: { pointer: "#{
|
355
|
+
source: { pointer: "#{base_path}.#{path_info[:field]}" } }
|
354
356
|
end
|
355
357
|
end
|
356
358
|
values.map do |msg|
|