runapi-core 0.5.1 → 0.5.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/lib/runapi/core/resource_helpers.rb +4 -2
- data/lib/runapi/core/version.rb +1 -1
- 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: 3716e984b8648825f23f5dba6a64e015ff70bf1c1f5711f96f0c41f57f8184f9
|
|
4
|
+
data.tar.gz: cbe52d93ce9609dd55da08d45bba595c8f95cebd80c24db7774a9be0765c3fb8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9499a9cc754db6ff4eaca48fb10f34216adee0beda90582724c0030c0caa486ee93effcbe8e04cab95fd3d3d253639f454b102b786019b27d085767df2d8f0ad
|
|
7
|
+
data.tar.gz: 644da423fc25d2eabb33d974012f18f46aa8f445efa34e901e9e3587107afdf37c43af091e8b82f2672c8538d4f4a8896a9df29c668762341fd7f697f702909a
|
|
@@ -170,7 +170,9 @@ module RunApi
|
|
|
170
170
|
conditions = rule["when"] || {}
|
|
171
171
|
return unless conditions.all? { |field, condition| rule_condition_met?(params, field, condition) }
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
# Sorted so the message matches every other SDK; Go maps have no declaration order.
|
|
174
|
+
context = conditions.sort_by { |field, _| field.to_s }
|
|
175
|
+
.map { |field, condition| rule_condition_label(field, condition) }.join(" and ")
|
|
174
176
|
qualifier = context.empty? ? "" : " when #{context}"
|
|
175
177
|
|
|
176
178
|
Array(rule["required"]).each do |field|
|
|
@@ -190,7 +192,7 @@ module RunApi
|
|
|
190
192
|
raise Core::ValidationError, "#{field} is not allowed#{qualifier}"
|
|
191
193
|
end
|
|
192
194
|
|
|
193
|
-
(rule["enum"] || {}).each do |field, allowed|
|
|
195
|
+
(rule["enum"] || {}).sort_by { |field, _| field.to_s }.each do |field, allowed|
|
|
194
196
|
next unless field_present?(params, field)
|
|
195
197
|
|
|
196
198
|
value = param_value(params, field)
|
data/lib/runapi/core/version.rb
CHANGED