I have a real hard time conceptually understanding something right about URLs for versions with versions.
Let's say I have an application that tracks recipes in a way very similar to a version control system, for example, in an old school such as RCS or something like that. Each version can be a working copy for some time, and then create a new version. Each version has comments associated with it and does not transmit comments. I can return historically at any time and look at the recipe as it develops, but each instance is always considered a version of the same recipe. I am trying to find the most suitable way to create URLs to link to them, and I am having trouble understanding some of the differences between similar sub-resources and temporary resources, etc.
The two main ways I've seen are:
> 1) query parameters
> -- /recipes/ultimate-thing -> List of available versions of Ultimate Thing
> -- /recipes/ultimate-thing?version=2 -> Version 2 of Ultimate Thing
> -- /recipes/ultimate-thing?version=latest -> Current working version of Ultimate Thing
2a) Nested resources with versions considered subresources
-- /recipes/ultimate-thing/versions/ -> List of available versions of Ultimate Thing
-- /recipes/ultimate-thing/versions/2 -> Version 2 of Ultimate Thing
-- /recipes/ultimate-thing -> Current working version of Ultimate Thing
2b) Nested resources with the list at the resource
-- /recipes/ultimate-thing -> List of available versions of Ultimate Thing
-- /recipes/ultimate-thing/versions/2 -> Version 2 of Ultimate Thing
-- /recipes/ultimate-thing/versions/latest -> Current working version of Ultimate Thing
, , , , , .
1 , , , POST (/recipes/ultimate-thing) , , - 404 /recipes, , POSTs /recipes/ultimate-thing ? , ? - /recipes/ultimate-thing/comments, /recipes/utlimate-thing/comments? Version = latest , 2b " ", 2a .
, 2, , , , , .
2b , stackoverflow, , , - /recipes/ultimate-thing/version/latest/comments. , , , , .
2a, - , , ? - , 1 , , ?
- /recipes/ultimate-thing/latest /recipes/ultimate-thing/2/comments, , ?
, - , , , .