1

I'm using Restler 3.0.0-RC6 and I'm confused on versioning. I have a v1 version (in a namespace) and now I need to make a breaking API change, so I want to create a v2 dir/namespace. However, I only need a couple of the API methods to change. How do I just modify those methods and not copy over the entire v1 directory?

Gargoyle
  • 9,590
  • 16
  • 80
  • 145

1 Answers1

0

If you want to serve a an API Class for multiple versions of the API, just implement iProvideMultiVersionApi interface which is basically adding a static function which returns the highest supported version. If you want to always support till the latest API version, You can add the following function to your API class (in Restler RC5)

/**
 * Maximum api version supported by the api class
 * @return int
 */
public static function __getMaximumSupportedVersion()
{
    return Scope::get('Restler')->_apiVersion;
}
Arul Kumaran
  • 983
  • 7
  • 23