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 version to every schema #44

Open
fnobilia opened this issue Jul 27, 2017 · 1 comment
Open

Add version to every schema #44

fnobilia opened this issue Jul 27, 2017 · 1 comment

Comments

@fnobilia
Copy link
Member

In Avro it is possible to add version at schema level

{
  "namespace": "org.radarcns.kafka.key",
  "type": "record",
  "name": "KeyMeasurement",
  "doc": "Measurement key in the RADAR-CNS project.",
  "fields": [
    {"name": "userId", "type": "string", "doc": "User Identifier created during the enrolment."},
    {"name": "sourceId", "type": "string", "doc": "Unique identifier associated with the source."}
  ],
  "version": "1.0"
}

The version property can then be accessed using

KeyMeasurement.getClassSchema().getObjectProps().get("version")

I am not sure if adding a version property at schema level will only complicate the maintainability or it is a good enhancement. We can track the version of each schema within the library, but we need to be more carful while committing a new version.

@blootsvoets @mbegalevibrent what do you think?

@fnobilia
Copy link
Member Author

Another though, using version

  • we can easily understand what schemas are stored in the schema registry just checking the version property
  • it could useful while troubleshooting

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

2 participants