sarutak opened a new pull request, #2383:
URL: https://github.com/apache/avro/pull/2383
AVRO-3812
## What is the purpose of the change
This PR fixes a issue that the Rust binding doesn't handle null namespaces
for canonicalized schema representation.
Considering the following schema, which contains namespaces of "".
```
{
"namespace": "",
"type": "record",
"name": "my_schema",
"fields": [
{
"name": "a",
"type": {
"type": "enum",
"name": "my_enum",
"namespace": "",
"symbols": ["a", "b"]
}
}, {
"name": "b",
"type": {
"type": "fixed",
"name": "my_fixed",
"namespace": "",
"size": 10
}
}
]
}
```
If we try to canonicalize this schema with the following code
```
let schema = Schema::parse_str(schema_str).unwrap().canonical_form();
println!("{schema}");
```
We get the following result.
```
{"name":".my_schema","type":"record","fields":[{"name":"a","type":{"name":".my_enum","type":"enum","symbols":["a","b"]}},{"name":"b","type":{"name":".my_fixed","type":"fixed","size":10}}]}
```
But .my_schema, .my_enum and .my_fixed should not starts with a dot.
## Verifying this change
Added new test and it passed with `cargo test avro_3812`.
## Documentation
No new docs as this PR doesn't contains new features.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]