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

How to check schema compatibility? #415

Open
erenon opened this issue Jun 13, 2023 · 2 comments
Open

How to check schema compatibility? #415

erenon opened this issue Jun 13, 2023 · 2 comments

Comments

@erenon
Copy link

erenon commented Jun 13, 2023

Thanks for the nice library!

I have a bunch of co-operating, separately deployed rust services, that communicate using capnproto. Servers advertise the schema they are using to publish data. When a client connects to a server, I'd like to make sure that the schema used by the client is compatible with the schema used by the server. Compatible, as in https://capnproto.org/language.html#evolving-your-protocol
How can I do that with this library? (I found schema loader in the C++ project, but couldn't connect that component to any piece in the rust lib) Thanks!

@dwrensha
Copy link
Member

capnproto-rust currently does not support loading new schemas at run time.

If you don't need to actually transmit the schemas, and you only want to check compatibility, then I expect that you should be able to set up some coordination by transmitting a type ID plus maybe some additional revision number.

@erenon
Copy link
Author

erenon commented Jun 13, 2023

Unfortunately, type ID is not enough to check compatibility (or even equivalence), as it only depends on the parent scopes id and the name of the struct (for structs), so if someone e.g: changes a string field to an integer field, the type id will remain the same. (Yes, I'd like to protect against silly changes)

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

No branches or pull requests

2 participants