Skip to content
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-3809: [Rust] Fix validate record reference with implicit namespace #2374

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

andrewinci
Copy link
Contributor

@andrewinci andrewinci commented Jul 20, 2023

AVRO-3809

What is the purpose of the change

The validate_internal function is not propagating schema's sub-namespaces resulting in validation error of valid value. This PR fixes the issue checking wether a record in the schema has a namespace and passing it through the recursive call to validate_internal instead of using by default the top level namespace.

Verifying this change

This change added tests and can be verified as follows:

  • Run cargo test

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

@github-actions github-actions bot added the Rust label Jul 20, 2023
Copy link
Member

@martin-g martin-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need a JIRA ticket too, for the changelog.

@andrewinci
Copy link
Contributor Author

andrewinci commented Jul 20, 2023

Hey @martin-g, is this something I can do? not sure how to create the jira ticket in the avro project

@andrewinci andrewinci requested a review from martin-g July 20, 2023 20:07
@andrewinci andrewinci changed the title [Rust] Fix validate record reference with implicit namespace AVRO-3809: [Rust] Fix validate record reference with implicit namespace Jul 21, 2023
@andrewinci
Copy link
Contributor Author

JIRA ticket attached

lang/rust/avro/src/types.rs Outdated Show resolved Hide resolved
@martin-g martin-g merged commit b431018 into apache:master Jul 21, 2023
13 checks passed
martin-g pushed a commit that referenced this pull request Jul 21, 2023
…ce (#2374)

* Fix validate record reference with implicit namespace

* AVRO-3809: Add the ticket number to the test method

---------

Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
(cherry picked from commit b431018)
@martin-g
Copy link
Member

Thank you for the contribution, @andrewinci !

RanbirK pushed a commit to RanbirK/avro that referenced this pull request May 13, 2024
…ce (apache#2374)

* Fix validate record reference with implicit namespace

* AVRO-3809: Add the ticket number to the test method

---------

Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants