javawebspherecontextpathapi-versioning

Double slash in context path in Websphere Application Server


I would like to know if it is possible to put a context path like this when deploying a WAR to Websphere Application Server: /api/v3.1, and another one with the same context path but for another version of the API to be launched in the same WAS.

In my team we want to version the API we are exposing to the clients, we have a monolithic application created with Spring Boot that is deployed into a WAS v8.5.

For that we have in mind the approach of versioning the API putting the version in the URI: https://example.com/api/v2.1 https://example.com/api/v3.0 It looks like it deployed correctly but when consuming it says that there is no file mapped to those URIs.


Solution

  • Yes. It is possible (and helpful for API versioning with the URI). The issue was to putting '/' (slash) at the end of the context path. It is valid only at the beginning (or when it is empty).