I figured out what happened. Sadly, if you got to that point there's no solution for it, just a workaround.
You will encounter this error if you first package a global class similar to this.
@RestResource(urlMapping='/my-pretty-path/*')
global with sharing class MyPrettyRestHandler {
@HttpGet
global static void doGet() {
// My pretty logic
}
}
Beautiful, isn't it?
But we all know the rules: once a global class gets packaged and the package is released that class cannot be retired anymore... well, kind of... there's still a painful way you can look into if you really want to (Revert a managed package to a beta version).
However there's literally NO WAY to EVER amend your mistakes if you persevere in the error... enter the @deprecated
annotation.
In the context of a REST handling class this useful - cough - annotation will help you achieve the perfect path nuking. You just add it like so:
@RestResource(urlMapping='/my-pretty-path/*')
@deprecated
global with sharing class ApplicationRestProvider {
...
Next you create a new package version (or simply a new version?) and you can high-five yourself. You just made my-pretty-path
unusable to time indefinite.
The solution for you now is the one of choosing a different path and ask all of your customers using that REST API path to migrate to a different path. Isn't that great? Well, in the end it's me who wanted it...
global
Apex method signature implementing the REST API?