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

feat(connector): support QualifiedReferenceSubjectNameStrategy #15287

Open
xiangjinwu opened this issue Feb 27, 2024 · 1 comment
Open

feat(connector): support QualifiedReferenceSubjectNameStrategy #15287

xiangjinwu opened this issue Feb 27, 2024 · 1 comment

Comments

@xiangjinwu
Copy link
Contributor

/// One schema can reference another schema
/// (e.g., import "other.proto" in protobuf)
#[derive(Debug, Deserialize)]
pub struct SchemaReference {
/// The name of the reference.
pub name: String,
/// The subject that the referenced schema belongs to
pub subject: String,
/// The version of the referenced schema
pub version: i32,
}

The name field is currently unused in our code base. It is dropped and assumed to always equal to the subject field by subsequent handling logic. This assumption does not hold when the producer registers with ReferenceSubjectNameStrategy=QualifiedReferenceSubjectNameStrategy rather than ReferenceSubjectNameStrategy= DefaultReferenceSubjectNameStrategy, or the human user makes up names arbitrarily not following the default.

For example, if the main protobuf file references mypackage/myfile.proto, its subject may be mypackage/myfile.proto (default) or mypackage.myfile (qualified) for the purpose of fetching from schema registry, but its name is always mypackage/myfile.proto for the purpose of compiling with protoc.

To fix, the following Vec<Subject> shall be replaced with a container with [(String, Subject)] (Vec/HashMap/BTreeMap/...).

/// get the latest version of the subject and all it's references(deps)
pub async fn get_subject_and_references(
&self,
subject: &str,
) -> SrResult<(Subject, Vec<Subject>)> {

@xiangjinwu xiangjinwu self-assigned this Feb 27, 2024
@github-actions github-actions bot added this to the release-1.7 milestone Feb 27, 2024
@xiangjinwu xiangjinwu removed this from the release-1.7 milestone Feb 27, 2024
Copy link
Contributor

This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant