如何在 olingo odata url 上进行版本控制

How to make versioning on the olingo odata url

我正在使用 Olingo OData 创建我的 restful API。我的问题是,是否可以在 API URL 上进行版本控制?比如我们现在是

http://localhost:9090/cars

我在想我能不能让它看起来像

http://localhost:9090/v1/cars

提前致谢。

我相信您使用某种 HttpServlet 来公开 OData 服务。然后,更改 URL 就是更改 web.xml 或任何地方的映射。

这是一个存储库,我在其中放了一个示例 Spring Olingo 应用程序:https://github.com/sollersconsulting/confitura2017/tree/master/snapgram. Mapping is done in the main class