-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AVRO-3900: [Rust] Make it possible to use custom names validators #2643
Conversation
WIP TODO: - Extract validators for enum symbols and record field names - Polish the APIs Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
5b9df53
to
75232b8
Compare
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
This way they use the public APIs of the crate, as a real user application. Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
899bf7d
to
c03e506
Compare
d62395d
to
7a018de
Compare
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
7a018de
to
c277f41
Compare
Otherwise there are timing issues with the initializations of the OnceLock's for the different validators. Parsing a Schema leads to initialization of the default validator and later it is impossible to set a custom one Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
…test_helper crate For some reason clearing the log messages in the tests destructor (#[dtor]) was failing for this example. Simplify the TestLogger to use the std thread_local!() instead of the third party ref_thread_local!() Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
eeb2b47
to
1dfe9f5
Compare
Just make sure the setup of the custom validators is done before the parsing of any schema to prevent registering the default validator (SpecificationValidator) Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
1dfe9f5
to
86c70b3
Compare
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
This worked on my machine (both |
I was waiting for a feedback from the reporter (@jslusher). |
@martin-g Hi! @rodneykeeling is a colleague of mine who was kind enough to test this branch in a new Rust consumer he's making. If he says it works, then we're good to go. Thanks for putting this together! |
) * AVRO-3900: [Rust] Make it possible to use custom validators * AVRO-3900: Add validator trait for enum symbol names * AVRO-3900: Introduce validator for RecordField's name * AVRO-3900: Extract the custom validators tests as IT tests This way they use the public APIs of the crate, as a real user application. * AVRO-3900: Polish APIs * AVRO-3900: Split the validator integration tests Otherwise there are timing issues with the initializations of the OnceLock's for the different validators. Parsing a Schema leads to initialization of the default validator and later it is impossible to set a custom one * AVRO-3900: Simplify generate_interop_data.rs example to not use avro_test_helper crate For some reason clearing the log messages in the tests destructor (#[dtor]) was failing for this example. Simplify the TestLogger to use the std thread_local!() instead of the third party ref_thread_local!() * AVRO-3900: Merge the validators integration tests in one test Just make sure the setup of the custom validators is done before the parsing of any schema to prevent registering the default validator (SpecificationValidator) * AVRO-3900: Improve the documentation Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> (cherry picked from commit 61df187)
…ache#2643) * AVRO-3900: [Rust] Make it possible to use custom validators * AVRO-3900: Add validator trait for enum symbol names * AVRO-3900: Introduce validator for RecordField's name * AVRO-3900: Extract the custom validators tests as IT tests This way they use the public APIs of the crate, as a real user application. * AVRO-3900: Polish APIs * AVRO-3900: Split the validator integration tests Otherwise there are timing issues with the initializations of the OnceLock's for the different validators. Parsing a Schema leads to initialization of the default validator and later it is impossible to set a custom one * AVRO-3900: Simplify generate_interop_data.rs example to not use avro_test_helper crate For some reason clearing the log messages in the tests destructor (#[dtor]) was failing for this example. Simplify the TestLogger to use the std thread_local!() instead of the third party ref_thread_local!() * AVRO-3900: Merge the validators integration tests in one test Just make sure the setup of the custom validators is done before the parsing of any schema to prevent registering the default validator (SpecificationValidator) * AVRO-3900: Improve the documentation Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
AVRO-3900
What is the purpose of the change
Verifying this change
Documentation