title: Swagger - Route defined in Swagger specification but there is no defined get operation
body: <p>I am creating a nodejs web service using swagger-ui. So I went on the online editor of swagger, did my yaml and exported it for nodejs server.
  When I am running in on my computer, with host as localhost (see yaml) I try to perform a PUT I got that message : </p>
  
  <pre><code>Error: Route defined in Swagger specification (/test) but there is no defined get operation.
      at send405 (/home/guillaume/Desktop/docker-swagger2-amp/node_modules/swagger-tools/middleware/swagger-router.js:307:13)
      at swaggerRouter (/home/guillaume/Desktop/docker-swagger2-amp/node_modules/swagger-tools/middleware/swagger-router.js:422:16)
      at call (/home/guillaume/Desktop/docker-swagger2-amp/node_modules/connect/index.js:239:7)
      at next (/home/guillaume/Desktop/docker-swagger2-amp/node_modules/connect/index.js:183:5)
      at swaggerValidator (/home/guillaume/Desktop/docker-swagger2-amp/node_modules/swagger-tools/middleware/swagger-validator.js:409:14)
      at call (/home/guillaume/Desktop/docker-swagger2-amp/node_modules/connect/index.js:239:7)
      at next (/home/guillaume/Desktop/docker-swagger2-amp/node_modules/connect/index.js:183:5)
      at swaggerMetadata (/home/guillaume/Desktop/docker-swagger2-amp/node_modules/swagger-tools/middleware/swagger-metadata.js:451:14)
      at call (/home/guillaume/Desktop/docker-swagger2-amp/node_modules/connect/index.js:239:7)
      at next (/home/guillaume/Desktop/docker-swagger2-amp/node_modules/connect/index.js:183:5)
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Failed to load http://127.0.0.1:8080/v2/test: Response for preflight has invalid HTTP status code 405
  </code></pre>
  
  <p>I have a get operation so I don't know what is the error. Here are my main files :</p>
  
  <p><strong>YAML:</strong></p>
  
  <pre><code>swagger: "2.0"
  info:
    description: "This is a sample server Petstore server.  You can find out more about     Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).      For this sample, you can use the api key `special-key` to test the authorization     filters."
    version: "1.0.0"
    title: "Swagger Petstore"
    termsOfService: "http://swagger.io/terms/"
    contact:
      email: "apiteam@swagger.io"
    license:
      name: "Apache 2.0"
      url: "http://www.apache.org/licenses/LICENSE-2.0.html"
  host: "127.0.0.1:8080"
  basePath: "/v2"
  tags:
  - name: "test"
    description: "Define yours parameters launching"
  schemes:
  - "http"
  paths:
    /test:
      put:
        tags:
        - "test"
        summary: "Add Test configuration and use it to launch Test"
        description: ""
        operationId: "addTestconf"
        consumes:
        - "application/xml"
        - "application/json"
        produces:
        - "application/xml"
        - "application/json"
        parameters:
        - in: "body"
          name: "body"
          description: "test configuration that needs to be used to run test"
          required: true
          schema:
            $ref: "#/definitions/test"
        responses:
          400:
            description: "Invalid ID supplied"
          404:
            description: "test not found"
          405:
            description: "Validation exception"
    /test/{TestId}:
      get:
        tags:
        - "test"
        summary: "Find Test config by ID"
        description: "Returns a Test config"
        operationId: "getTestConfigurationById"
        produces:
        - "application/xml"
        - "application/json"
        parameters:
        - name: "testId"
          in: "path"
          description: "ID of test config to return"
          required: true
          type: "integer"
          format: "int64"
        responses:
          200:
            description: "successful operation"
            schema:
              $ref: "#/definitions/test"
          400:
            description: "Invalid ID supplied"
          404:
            description: "test Config not found"
  
  
  definitions: ........ 
  </code></pre>
  
  <p><strong>index.js:</strong></p>
  
  <pre><code>'use strict';
  
      var fs = require('fs'),
          path = require('path'),
          http = require('http')
  
      var app = require('connect')();
      var swaggerTools = require('swagger-tools');
      var jsyaml = require('js-yaml');
      var serverPort = 8080;
  
      // swaggerRouter configuration
      var options = {
        swaggerUi: path.join(__dirname, '/swagger.json'),
        controllers: path.join(__dirname, './controllers'),
        useStubs: process.env.NODE_ENV === 'development' // Conditionally turn on stubs (mock mode)
      };
  
      // The Swagger document (require it, build it programmatically, fetch it from a URL, ...)
      var spec = fs.readFileSync(path.join(__dirname,'api/swagger.yaml'), 'utf8');
      var swaggerDoc = jsyaml.safeLoad(spec);
  
      // Initialize the Swagger middleware
      swaggerTools.initializeMiddleware(swaggerDoc, function (middleware) {
        // Interpret Swagger resources and attach metadata to request - must be first in swagger-tools middleware chain
        app.use(middleware.swaggerMetadata());
  
        // Validate Swagger requests
        app.use(middleware.swaggerValidator());
  
        // Route validated requests to appropriate controller
        app.use(middleware.swaggerRouter(options));
  
        // Serve the Swagger documents and Swagger UI
        app.use(middleware.swaggerUi());
  
        // Start the server
        http.createServer(app).listen(serverPort, function () {
          console.log('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort);
          console.log('Swagger-ui is available on http://localhost:%d/docs', serverPort);
        });
  
      });
  </code></pre>
  
  <p><strong>and my controllers :</strong>
  <strong>test_configuration.js:</strong></p>
  
  <pre><code>'use strict';
  
  var url = require('url');
  
  var test = require('./testService');
  
  module.exports.addTestConf = function addTestConf(req, res, next) {
    test.addTestConf(req.swagger.params, res, next);
  };
  
  module.exports.getTestConfigurationById = function getTestConfigurationById(req, res, next) {
    test.getTestConfigurationById(req.swagger.params, res, next);
  };
  </code></pre>
  
  <p><strong>test_configurationService.js:</strong></p>
  
  <pre><code>use strict';
  
  exports.addTestConf = function(args, res, next) {
    res.end();
  }
  
  exports.getTestConfigurationById = function(args, res, next) {
    res.end();
  }
  </code></pre>