You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, so I experimented a bit on how to handle different version in a clean way. The solution I came up with would require changes to the SpaceAPI schema. So I'm not sure if this issue is the right place for it ;)
Proposal
The only thing I came up with is apparently not compatible with the current specification. We would have to add a field like version that states the exact version of the currently provided api. Together with that change I would suggest to make the api_compatibility field optional. IIRC, the version field was removed with schema v14.
Having a distinct version field was also the outcome of a short google-research on how to implement/handle different API versions (not only in Rust, but in a more general approach).
Assuming we have the version field, we could do something like this:
FYI, this implementation or rather the enum reminds me of the type std::net::IpAddr (see here)
Don't get me wrong, I do not intend to change the schema solely for making the implementation in Rust more straight forward. In my personal opinion, the server of the SpaceAPI should just serve one specific version mentioned in one of its json fields. The server could also provide multiple endpoints serving different versions. The client side, that queries that data should take care of the version stuff and should decide on which version it supports. So to speak, the person that implements the client side should take care of checking, which versions are compatible or rather which fields of interest are available in which versions and act accordingly. In essence, I suggest to move the compatiblity decision from the server to the client side.
Is that something you can agree on?
The text was updated successfully, but these errors were encountered:
Making it possible to be compatible with multiple versions at once was explicitly the goal of introducing the api_compatibility field, so this is unlikely to be changed 🙂
My suggestion in #118 (comment) would be to keep supporting 2 versions at once, meaning that v0.13 support is removed when adding v15. This way we can work with manually designed builders and validation logic, without having to rely on Serde for that.
Hi, so I experimented a bit on how to handle different version in a clean way. The solution I came up with would require changes to the SpaceAPI schema. So I'm not sure if this issue is the right place for it ;)
Proposal
The only thing I came up with is apparently not compatible with the current specification. We would have to add a field like
version
that states the exact version of the currently provided api. Together with that change I would suggest to make theapi_compatibility
field optional. IIRC, theversion
field was removed with schema v14.Having a distinct
version
field was also the outcome of a short google-research on how to implement/handle different API versions (not only in Rust, but in a more general approach).Assuming we have the
version
field, we could do something like this:FYI, this implementation or rather the enum reminds me of the type
std::net::IpAddr
(see here)Don't get me wrong, I do not intend to change the schema solely for making the implementation in Rust more straight forward. In my personal opinion, the server of the SpaceAPI should just serve one specific version mentioned in one of its json fields. The server could also provide multiple endpoints serving different versions. The client side, that queries that data should take care of the version stuff and should decide on which version it supports. So to speak, the person that implements the client side should take care of checking, which versions are compatible or rather which fields of interest are available in which versions and act accordingly. In essence, I suggest to move the compatiblity decision from the server to the client side.
Is that something you can agree on?
The text was updated successfully, but these errors were encountered: