schema_registry_client 0.0.9 → 0.0.10

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: d0919f12f0457fbdf7becd62389a7ed72e34afe9d7f3ce5c819f2e0ebf145174
4
- data.tar.gz: 4dc5c91669e508e89bc07763bebb6b754403ee72ccbe125ecfc888c48cf974fa
3
+ metadata.gz: d3b14147c915a8acf65e41b25d76d5dd1c8216ac93d0bb493b8585459c191dde
4
+ data.tar.gz: d96ab79b926b29316d79bdba4dea5fc6676a5da8032a279ceb1cf18cf52ee7a6
5
5
  SHA512:
6
- metadata.gz: 07d614eaceb30420a69221399fab2e360f3f3b4089e5271b42fcaca30eb9f643cebcdd59187bdfc6a33d721641b960e2855fefce4703e59f455e459088bbd996
7
- data.tar.gz: 65a8cf4a6899e8f32febb2b408ebb20ed379224b7fbd0d716da33c6e0e6c10844559e5d4e1af73c3ee06a1601ecd0dc3853137aa3987837157bbd07c07655a21
6
+ metadata.gz: 5239758e46fb68da608d5bafd6947384d4849cce7db3e9cfb55e327b35caaf44fdf30238fb66ffbee2d4277eedbea236528c29549083d7a2c5272359d68f65c7
7
+ data.tar.gz: 0c2debfe3b410f38366058a8fa5905f1a22e21e6433e1a555c15465bf171ddb989641428edfc699e68c3137845e36eff1eb9245c82cde3a266b76eeb0fe60f20
data/CHANGELOG.md CHANGED
@@ -7,9 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## UNRELEASED
9
9
 
10
- # 0.0.9 - 2026-02-11
10
+ # 0.0.10 - 2026-02-11
11
11
 
12
- * Fix: Do not send `schemaType` if schema type is `AVRO`, for backwards compatibility with older schema registries.
12
+ * Fix: Do not send `schemaType` or `references` if schema type is `AVRO`, for backwards compatibility with older schema registries.
13
13
 
14
14
  # 0.0.8 - 2026-02-04
15
15
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- schema_registry_client (0.0.9)
4
+ schema_registry_client (0.0.10)
5
5
  avro
6
6
  excon
7
7
  google-protobuf
@@ -73,11 +73,12 @@ module SchemaRegistry
73
73
  # @param references [Array<Hash>] optional references to other schemas
74
74
  # @return [Integer] the ID of the registered schema
75
75
  def register(subject, schema, references: [], schema_type: "PROTOBUF")
76
- body = {references: references,
77
- schema: schema.to_s}
76
+ puts("schema_type #{schema_type}")
77
+ body = {schema: schema.to_s}
78
78
  # Not all schema registry versions support schemaType
79
79
  if schema_type != "AVRO"
80
80
  body[:schemaType] = schema_type
81
+ body[:references] = references
81
82
  end
82
83
  data = post("/subjects/#{@schema_context_prefix}#{CGI.escapeURIComponent(subject)}/versions",
83
84
  body: body.to_json)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SchemaRegistry
4
- VERSION = "0.0.9"
4
+ VERSION = "0.0.10"
5
5
  end
@@ -117,8 +117,7 @@ RSpec.describe "encoding" do
117
117
  it "should encode a simple message" do
118
118
  schema = File.read("#{__dir__}/schemas/simple/v1/SimpleMessage.avsc")
119
119
  stub = stub_request(:post, "http://localhost:8081/subjects/simple/versions")
120
- .with(body: {"references" => [],
121
- "schema" => schema}).to_return_json(body: {id: 15})
120
+ .with(body: {"schema" => schema}).to_return_json(body: {id: 15})
122
121
  msg = {"name" => "my name"}
123
122
  encoded = schema_registry_client.encode(msg, subject: "simple", schema_name: "simple.v1.SimpleMessage")
124
123
  # Avro encoding: magic byte (0x00) + schema id (4 bytes, big-endian) + Avro binary data
@@ -135,8 +134,7 @@ RSpec.describe "encoding" do
135
134
  it "should encode a complex message with nested record" do
136
135
  schema = File.read("#{__dir__}/schemas/referenced/v1/MessageBA.avsc")
137
136
  stub = stub_request(:post, "http://localhost:8081/subjects/referenced/versions")
138
- .with(body: {"references" => [],
139
- "schema" => schema}).to_return_json(body: {id: 20})
137
+ .with(body: {"schema" => schema}).to_return_json(body: {id: 20})
140
138
  msg = {
141
139
  "simple" => {
142
140
  "name" => "my name"
@@ -170,8 +168,7 @@ RSpec.describe "encoding" do
170
168
  File.write("#{multi_schema_path}/MultiFieldMessage.avsc", schema_json)
171
169
 
172
170
  stub = stub_request(:post, "http://localhost:8081/subjects/multi/versions")
173
- .with(body: {"references" => [],
174
- "schema" => schema_json}).to_return_json(body: {id: 25})
171
+ .with(body: {"schema" => schema_json}).to_return_json(body: {id: 25})
175
172
 
176
173
  msg = {"name" => "Alice", "age" => 30}
177
174
  encoded = schema_registry_client.encode(msg, subject: "multi", schema_name: "test.v1.MultiFieldMessage")
@@ -189,8 +186,7 @@ RSpec.describe "encoding" do
189
186
  it "should validate schema before encoding" do
190
187
  schema = File.read("#{__dir__}/schemas/simple/v1/SimpleMessage.avsc")
191
188
  stub_request(:post, "http://localhost:8081/subjects/simple/versions")
192
- .with(body: {"references" => [],
193
- "schema" => schema}).to_return_json(body: {id: 15})
189
+ .with(body: {"schema" => schema}).to_return_json(body: {id: 15})
194
190
 
195
191
  # Invalid message - missing required field
196
192
  msg = {"invalid_field" => "value"}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_registry_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner