-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
The new versioning is awesome, but it may not work with existing projects. I am used to versioning such as /v1 as many others. In my current project, I was using this way of versioning and wrote a custom ApiVersionParser.
public class ApiVersioningParser implements ApiVersionParser {
@Override
public Comparable parseVersion(String version) {
// Remove the "v" prefix
if (version.startsWith("v") || version.startsWith("V")) {
version = version.substring(1);
} else {
// Default versions for paths like favicon.icon
version = "1";
}
return version;
}
}Initially, nothing seemed wrong here until I started using another popular framework called OpenAPI. What ended up happening is that OpenAPI also likes the same versioning strategy. That meant that all Swagger v3 endpoints were suddenly mapped incorrectly, for example /v3/api-docs. Up until now, everyone has their own way of implementing strategies; these kinds of conflicts are bound to happen. To prevent this, I thought we could maybe add more fine-grained filtering. Maybe not only on versioning, but also being able to ignore certain paths based on something like a regex.