code: function mockImplementation (req, res, next) {
      if (res.swagger) {
        // Determine the semantics of this request
        let request = new SemanticRequest(req);
  
        // Determine which mock to run
        let mock;
        if (request.isCollection) {
          mock = queryCollection[req.method] || editCollection[req.method];
        }
        else {
          mock = queryResource[req.method] || editResource[req.method];
        }
  
        // Get the current DataStore (this can be changed at any time by third-party code)
        let db = util.isExpressApp(router) ? router.get("mock data store") || dataStore : dataStore;
        db.__router = router;
  
        // Run the mock
        util.debug("Running the %s mock", mock.name);
        mock(req, res, next, db);
      }
      else {
        next();
      }
    }
docs: Runs the appropriate mock implementation.