title: Example code for a working POST in swagger go
body: <p>What am I doing wrong in this approach?</p>
  
  <p>I try to reimplent an old API, however the go implementation. Basically i try to POST a list of strings to the server. but all i get is an error 500 from the server, whenn i try:</p>
  
  <pre><code>go run gen/cmd/greeter-server/main.go --port=3000  &amp;
  echo '["a","b"]' |  http -v post  :34307/api/greeting/2.0/revisit
  </code></pre>
  
  <p>RESULT</p>
  
  <pre><code>HTTP/1.1 500 Internal Server Error
  Content-Length: 68
  Content-Type: application/json
  Date: Mon, 06 Mar 2017 17:41:16 GMT
  
  {
      "code": 500,
      "message": "no consumer registered for application/json"
  }
  </code></pre>
  
  <p>This is the code i try to implement.</p>
  
  <pre><code>  api.TrackingRevisitHandler = operations.TrackingRevisitHandlerFunc(
                  func(params operations.TrackingRevisitParams) middleware.Responder {
  
                          list := params.IdList
                          log.Printf("%v\n",list)
                          return operations.NewTrackingRevisitOK().WithPayload("RESULT")
          })
  </code></pre>
  
  <p>I use </p>
  
  <pre><code>swagger generate server -A greeter -t gen -f ./swagger/swagger.yml
  </code></pre>
  
  <p>to generate the server from this yaml:</p>
  
  <pre><code>---
  swagger: '2.0'
  info:
    version: 1.0.0
    title: Greeting Server
  
  basePath: "/api/greeting/2.0"
  
  paths:
    /revisit:
      post:
        produces:
        - application/json
        consumes:
        - application/json
        parameters:
          - name: site
            required: true
            type: string
            in: query
            description: site name
  
          - name: userlist
            in: body
            description: list of users
            required: true
            schema:
              "$ref": "#/definitions/Userlist"
  
  
        operationId: trackingRevisit
  
        responses:
          200:
            description:  return list of users which need revisit
            schema:
              type: string
  </code></pre>