REST api versioning (only version the representation, not the resource itself)

前端 未结 7 861
-上瘾入骨i
-上瘾入骨i 2020-12-04 06:39

I had a look at Best practices for API versioning?, but am not quite convinced of the answer, so I am question the versioning part again with a more specific example. I am h

7条回答
  •  猫巷女王i
    2020-12-04 07:09

    Another approach could be to say that "one representation has multiple APIs":

    http://xxx/user/123/api/1.json
    

    And if you wish, you could return the representation using the latest API when requesting like this:

    http://xxx/user/123.json
    

    Personally I like other solutions better but this is another approach that I haven't seen suggested here yet.

提交回复
热议问题