Restify and semver wildcards

Question: How do you specify a wildcard semvar in your accept-version header? (Restify 2.5.0)

The Goal: Accept 1.x.x. Looking at the documentation it looks like this is achieved by setting the semver to ~1 or 1.x. However Restify does not seem to handle this.

Server:

  var server = restify.createServer({
            version: '1.1.0',...

Route:

  server.get({
                    path: /^\/([a-zA-Z0-9_\.~-]+)\/(.*)/,
                    version: '1.x' // also tried '~1'
            },
            function(req, res, next){
                    req.log.debug(req.params,'Request');
                    res.send(req.params);
    });

The result:

{"code":"InvalidVersion","message":"* is not supported by GET /sys/blah"}

I was able to get this working by setting the routes version to '1.0.5'(Example in range) and then specifying the clients accept-version to ~1, however, it seems like it would be better suited to set a wildcard on the server side. Any ideas?

The server should be the authority for the version it is exposing so it doesn't make sense for it to be fuzzy/reasonable close (using the tilde prefix).

Restify is using semver for exposing versions (more specifically node-semver) so ~1 isn't a valid version. As you've discovered, the client can ask for as specific a version it would like or ask for a range.