Discussion about API versioning in the Vision plugin and the confusion around stable vs experimental versions.
15 replies
Last updated: Sep 9, 2021
J
Is there a reason the API version numbers in the Vision plugin don’t match the numbers specified here: https://www.sanity.io/docs/api-versioning . Maybe I’m missing something?
Sep 8, 2021, 7:32 PM
J
Oh ok, I think I understand.v1 = outdated
vX = current, most recent
Is there a reason v2021-03-25 is there? Is that also essentially v1?
vX = current, most recent
Is there a reason v2021-03-25 is there? Is that also essentially v1?
Sep 8, 2021, 7:47 PM
J
I missed the experimental section of that page, thx for the help!
Sep 8, 2021, 7:49 PM
vX is the experimental version that's likely to change or be unstable. So proceed with caution! The v2021-03-25 version will be your best bet in terms of getting the most recent, stable version.
Sep 8, 2021, 7:50 PM
Thats the version that follows the date incremented version numbers that we use now.
Sep 8, 2021, 7:51 PM
J
Oh ok, where do we following what is considered the most recent stable version?
I thought the current stable is what was listed at the top of
https://www.sanity.io/docs/api-versioning#71d69d9f4146 . For instance, currently
I thought the current stable is what was listed at the top of
https://www.sanity.io/docs/api-versioning#71d69d9f4146 . For instance, currently
v2021-06-07
Sep 8, 2021, 7:52 PM
Ah, yeah I see how that's confusing. Using v2021-03-25 in Vision will be what you want. On your frontend when configuring a client you'd use the current date to make sure you're getting the right one. We'll add in a note to the docs to make that more clear!
Sep 8, 2021, 8:06 PM
J
Sorry, I’m not sure I follow 😞. If v2021-03-25 is the most recent stable, and we’re recommended to use the current date (such as today), would we be getting v2021-06-07 or v2021-03-25?
Is v2021-06-07 the most recent experimental version and v2021-03-25 is the most recent stable?
Is v2021-06-07 the most recent experimental version and v2021-03-25 is the most recent stable?
Sep 8, 2021, 8:18 PM
Sorry, let me see if I can clarify: using v2021-06-07, for example, would use the most recent, stable API version released on or before June 7, 2021. v2021-03-25 would would use the most recent, stable API version released on or before March 25, 2021. You'll only end up using an experimental version if you use vX.
Sep 8, 2021, 8:49 PM
Y
I think the reason it's a bit confusing is that the version number notation is "overloaded"; it's used both in a "filter" capacity in the URL, where it means " give me the most recent <= {date}", and as names for actual versions, where it means "the version released at {date}" :)
Sep 8, 2021, 9:05 PM
Y
In this particular case, both v2021-03-25 and v2021-06-07 requests result in the actual version v2021-03-25 (since there's no newer stable version)
Sep 8, 2021, 9:07 PM
Y
In this particular case, both v2021-03-25 and v2021-06-07 requests result in the actual version v2021-03-25 (since there's no newer stable version)
Sep 8, 2021, 9:07 PM
J
Ah right, thank you both! I think my confusion came from the docs. I thought there was some relevance to the date of v2021-06-07 but it sounds like that was just an arbitrary date example. The reason I made this thread originally was because the Vision plugin explicitly references v2021-03-25, but the docs reference v2021-06-07 (the arbitrary example date).
Sep 8, 2021, 9:11 PM
J
Thanks again!!
Sep 8, 2021, 9:12 PM
S
I have this confusion everytime, may be add some info in brackets?
Sep 9, 2021, 3:48 PM
S
eg:vX (beta)v2021-03-25 (latest, stable)
v1 (old)
v1 (old)
Sep 9, 2021, 3:49 PM
Sanity– build remarkable experiences at scale
Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.