schema_registry_converter
schema_registry_converter copied to clipboard
Handle slash in subject name while performing Schema Registry API calls
Description
- One of the limitations mentioned in schema registry documentation is that subject name can contain "/" character. However, we have to escape it in the schema registry APIs
- This change replaces "/" in the subject name with "%2F" thereby allowing API calls to succeed
Use case
- We have one of our schemas referencing other schema containing "/" in its name. Due to the above mentioned limitation,
schema_registry_converter::async_impl::proto_decoder::deserialize_with_context
method is returningCould not get id from response
as the response. After this fix, deserialize_with_context is returning valid data and things are working E2E as expected
Testing
- Tested on my confluent schema registry with subject name as "a/b/c.proto"
API call failing with
{"error_code":404,"message":"HTTP 404 Not Found"}
error before the change and the call has succeeded after changing subject name to "a%2Fb%2Fc.proto"