What's the best practice to for Thrift file (api) versioning?

前端 未结 2 1744
孤独总比滥情好
孤独总比滥情好 2021-02-10 17:33

I have an API written in thrift. Example:

service Api {
  void invoke()
}

It does something. I want to change the behavior to do something else

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-10 18:01

    For your specific scenario, you can just add a new method (named something else) that does the new thing. In the future, I would avoid naming methods invoke or similar for this exact reason. Your service will now have a method invoke that does some unknown thing and another method (hopefully named better) that does what it says it does. This may lead to confusion by your users, but everything will still work.

提交回复
热议问题