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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2346cc3e1789c4eb393386b3c446e7e2b745ac4bfd64bac272a6dc7e352afe44
4
- data.tar.gz: e488401b9e7161b27027ac355c60c4b071195e8084f050ca26f02e10d31ea033
3
+ metadata.gz: 3716e984b8648825f23f5dba6a64e015ff70bf1c1f5711f96f0c41f57f8184f9
4
+ data.tar.gz: cbe52d93ce9609dd55da08d45bba595c8f95cebd80c24db7774a9be0765c3fb8
5
5
  SHA512:
6
- metadata.gz: e5db3a20265fe7181ef3c6a9dee576df3e9d34d00b0fd11317b6dd7789fec8c5661d6cbe73f7214c69ebd0ad76e2a1960a1e7b851121520c998bf1aac707bc3c
7
- data.tar.gz: 144b7dbd4205dbf424d57432435f5b2edac9b64e4db2f42f154ea9024e6cc963ce2dd2aea0e046f7351c572b48f7867daac9f887ae511a75c331e3cfeec15d32
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
- context = conditions.map { |field, condition| rule_condition_label(field, condition) }.join(" and ")
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)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module RunApi
4
4
  module Core
5
- VERSION = "0.5.1"
5
+ VERSION = "0.5.2"
6
6
  end
7
7
 
8
8
  VERSION = Core::VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI