smplkit 1.0.27 → 2.0.0

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: 85fc65604b1b3374714d8834023aa65f658f08d275b484f05ab7bb4a3105f6ba
4
- data.tar.gz: 72fad8395cc96a5e21b0501d888fd735060da7f7a8c0ca71f6a047b1d371cea5
3
+ metadata.gz: d493cd747db42a8ca33e559fea4775b1b8ac4ce9b0d67a840c42078759ccc527
4
+ data.tar.gz: 7f386e4671aa2d5e339264007ba46a7b41c9a9cfa47ff1580514aee3248ebd86
5
5
  SHA512:
6
- metadata.gz: 69264993f3f28149eeda7d424ce52559360e5e17a9e32f1db661f6e140fa1afec14b860bd914e8cc42d2d16bc63dd0a9eba65a22a1748afaa33d5b20cef9b807
7
- data.tar.gz: 64ecdaa7dbab15ebe416b5af127b4a694a412eae6d8a25d0f55a741bd0caef45d375a769557f323e62eb911dac4940e6c7a29eda29d8d82b178de4662c3af1a9
6
+ metadata.gz: 6c8cdbc1352d1d1798f88a28047364dd70b44f79e61957e97a4234aeb70eec115a84cad72acca43f9ea38eb13ef71b4061ad97a35719d9f172a138e9a8ce1e04
7
+ data.tar.gz: 03eca6e00372adf7cebbdebc719f98ffdc3b2ae0768ba788e1205d29abbeeef8755e32a58a14cee8ac52685274de53ecd15bad4c8c07009fac99f4bd7dcfd132
@@ -133,7 +133,7 @@ module Smplkit
133
133
  actor_type: attrs.actor_type,
134
134
  actor_id: attrs.actor_id,
135
135
  actor_label: attrs.actor_label,
136
- data: attrs.data || {},
136
+ data: Smplkit::Helpers.deep_stringify_keys(attrs.data || {}),
137
137
  idempotency_key: attrs.idempotency_key,
138
138
  do_not_forward: attrs.do_not_forward || false
139
139
  )
@@ -196,10 +196,10 @@ module Smplkit
196
196
  slug: a.slug,
197
197
  forwarder_type: a.forwarder_type,
198
198
  enabled: a.enabled.nil? || a.enabled,
199
- filter: a.filter,
199
+ filter: Smplkit::Helpers.deep_stringify_keys(a.filter || {}),
200
200
  transform: a.transform,
201
201
  http: ForwarderHttp.from_wire(a.http),
202
- data: a.data || {},
202
+ data: Smplkit::Helpers.deep_stringify_keys(a.data || {}),
203
203
  created_at: a.created_at,
204
204
  updated_at: a.updated_at,
205
205
  deleted_at: a.deleted_at,
@@ -224,7 +224,7 @@ module Smplkit
224
224
  event_id: a.event_id,
225
225
  attempt_number: a.attempt_number,
226
226
  status: a.status,
227
- request: a.request,
227
+ request: Smplkit::Helpers.deep_stringify_keys(a.request || {}),
228
228
  response_status: a.response_status,
229
229
  response_body: a.response_body,
230
230
  latency_ms: a.latency_ms,
@@ -11,5 +11,22 @@ module Smplkit
11
11
  def key_to_display_name(key)
12
12
  key.tr("-_", " ").split.map(&:capitalize).join(" ")
13
13
  end
14
+
15
+ # Recursively convert all Hash keys to strings. Used at the wrapper
16
+ # boundary to normalise the symbol-keyed hashes the openapi-generator
17
+ # client emits when deserialising ``Hash<String, Object>`` fields
18
+ # (a by-product of its ``JSON.parse(symbolize_names: true)`` call).
19
+ # The other SDKs (Python, TypeScript, Go, Java, C#) all return string
20
+ # keys; this keeps Ruby consistent with that contract.
21
+ def deep_stringify_keys(value)
22
+ case value
23
+ when Hash
24
+ value.each_with_object({}) { |(k, v), out| out[k.to_s] = deep_stringify_keys(v) }
25
+ when Array
26
+ value.map { |v| deep_stringify_keys(v) }
27
+ else
28
+ value
29
+ end
30
+ end
14
31
  end
15
32
  end
@@ -129,14 +129,7 @@ module Smplkit
129
129
  module_function
130
130
 
131
131
  def stringify(value)
132
- case value
133
- when Hash
134
- value.each_with_object({}) { |(k, v), out| out[k.to_s] = stringify(v) }
135
- when Array
136
- value.map { |v| stringify(v) }
137
- else
138
- value
139
- end
132
+ Smplkit::Helpers.deep_stringify_keys(value)
140
133
  end
141
134
 
142
135
  # Convenience: produce a string-keyed Hash from a generated model.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smplkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.27
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Smpl Solutions LLC