DGS-22734 Add Accept-Version header#2536
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds an Accept-Version header to Schema Registry REST API calls and implements several enhancements including improved bytes type handling in Avro serialization/deserialization, DEK creation API improvements, and AWS credentials handling updates.
- Adds Accept-Version: 8.0 header to all Schema Registry REST requests
- Enhances Avro serialization to handle bytes type more efficiently with direct byte array operations
- Updates DEK creation to try new API endpoint with subject in path, falling back to legacy endpoint
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Confluent.SchemaRegistry/Rest/RestService.cs | Adds Accept-Version header constant and includes it in HTTP requests |
| src/Confluent.SchemaRegistry.Serdes.Avro/SpecificSerializerImpl.cs | Adds direct bytes handling for Avro byte array serialization |
| src/Confluent.SchemaRegistry.Serdes.Avro/SpecificDeserializerImpl.cs | Adds direct bytes handling for Avro byte array deserialization |
| src/Confluent.SchemaRegistry.Encryption/Rest/DekRestService.cs | Updates DEK creation to use new API with fallback to legacy endpoint |
| src/Confluent.SchemaRegistry.Encryption.Aws/AwsKmsDriver.cs | Adds support for AWS web identity token file authentication |
| test/Confluent.SchemaRegistry.Serdes.UnitTests/SerializeDeserialize.cs | Adds assertion to verify bytes serialization format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| currentSchemaData.AvroWriter.Write(data, new BinaryEncoder(stream)); | ||
| // If the writer schema is a simple bytes type, write bytes directly | ||
| if (currentSchemaData.WriterSchema.Tag == Avro.Schema.Type.Bytes && data is byte[] byteData) |
There was a problem hiding this comment.
[nitpick] The condition combines schema type checking with runtime type checking. Consider extracting this logic into a separate method with a descriptive name like ShouldSerializeBytesDirectly for better readability.
Justin Wang (Claimundefine)
left a comment
There was a problem hiding this comment.
LGTM
What
Checklist
References
JIRA:
Test & Review
Open questions / Follow-ups