-
Notifications
You must be signed in to change notification settings - Fork 79
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
Latest Schema method does not return "Schema Id" #53
Comments
The subject latest endpoint does not return the schema id, just the version and the schema as seen here: https://docs.confluent.io/current/schema-registry/develop/api.html
|
Hi @nrwiersma I was trying to figure this out as well. Looking at the doc you linked above, it looks like the It isn't in the example response but it is in the response description. I was also able to confirm running the registry locally with the
Sample response: {
"subject": "test",
"version": 1,
"id": 2,
"schema": "..."
}
thanks! |
No, there is a mismatch between the reported returns and the example. Interestingly I checked https://github.com/salsify/avro-schema-registry which I have for a long time used as my registry, and it does not return the id in this command. I assume it was added since the client was added. I will gladly add an additional function to get it, to not break backward compatibility, but it should be noted for the kafka case, this should not be needed. We instead used fingerprint checking that is provided by https://github.com/salsify/avro-schema-registry which tells you if a schema is registered and what its id is. This allows the publication of multiple versions of the schema at the same time by multiple versions of your application. |
That would be fantastic, thank you. Let me know if a PR would be helpful. I'm relatively new to go but happy to try my hand at one. One of the reason my use cases needs this ability is because our producing application consumes unique messages from customers. The application looks up the latest schema for a customer by subject, then writes the data to kafka. I don't think we would be able to use the pattern you described because our application does not have the schema in the source code? |
Fair enough. If you would like to try your hand at it, that would be great, I am always glad to get PRs. We cannot add it to the current function at this time, as it would be backward breaking. I would suggest you add function Have fun 😄 |
@nrwiersma sounds good. I have a PR ready but I'm getting a "access denied" error when trying to push my new branch to the repo. Could you give me write access or is there another way to create a PR? Thanks |
Hi. You need to make a fork of it and then make your branch. You can then create the PR against |
thanks that did the trick |
Fixed by #56 |
The fix can be found in v1.2.0, with thanks to @mcgrawia for providing it. |
The AVRO client method
GetLatestSchema
only returns schema but not the schema_id associated with it. Also there's no other method in the library to retrieve it. https://github.com/hamba/avro/blob/master/registry/client.go#L183-L191The text was updated successfully, but these errors were encountered: