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

Add CreateSchemaWithIDAndVersion() to the sr package #849

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

mihaitodor
Copy link
Contributor

This would come in handy when someone is trying to migrate schemas between two Schema Registry instances and they wish to retain the original IDs to avoid schema ID translation when migrating Kafka messages.

pkg/sr/api.go Outdated
return SubjectSchema{}, err
}
} else {
if err := cl.post(ctx, path, SubjectSchema{Schema: s, ID: id}, &into); err != nil {
Copy link
Owner

Choose a reason for hiding this comment

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

Is this a RP specific thing, or the API in general?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found it in the Confluent docs here: https://docs.confluent.io/platform/current/schema-registry/installation/migrate.html#migrate-individual-schemas. See how they POST the schema ID. It’s not mentioned in the API reference though…

@mihaitodor mihaitodor force-pushed the add-create-schema--with-fixed-id branch from af3fea9 to 143aeab Compare November 18, 2024 22:00
@mihaitodor mihaitodor changed the title Add CreateSchemaWithID() to the sr package Add CreateSchemaWithIDAndVersion() to the sr package Nov 18, 2024
@mihaitodor
Copy link
Contributor Author

As per the Slack chat, I updated this new API to include the version ID and set the omitempty tags accordingly. I think it should work OK now.

@twmb twmb merged commit 293b7c4 into twmb:master Dec 2, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants