title: flasgger YAML for a POST JSON API
body: <p>Following this post :
  <a href="https://stackoverflow.com/questions/43218413/get-data-json-in-flask">Get Data JSON in Flask</a></p>
  
  <p>I was able to write a simple API where i post a json objet (a first name &amp; last name &amp; a generate ID) to insert it into a database.</p>
  
  <p>After that, i want to use swagger/flasgger to model it.
  It's already working for the get or get_by_id, but impossible for the POST to work.</p>
  
  <p>In my python code i have this :</p>
  
  <pre><code>from flask import Flask, jsonify, request
  @app.route('/api/v1/list', methods=['POST'])
  @swag_from('index_post.yml')
  def add_entry():
      request_json = request.get_json()
      value1 = request_json.get('First_Name')
      value2 = request_json.get('Last_Name')
      if value1 is not None and value2 is not None:
          cursor.execute("INSERT INTO person (first_name,last_name) VALUES 
          (%s,%s)", (value1, value2))
      data = conn.commit()
      return jsonify(data)
  </code></pre>
  
  <p>And in the YAML file, i have :</p>
  
  <pre><code>paths:
  /api/v1/list:
  post:
  description: testpost
  operationId: PostNewName
  consumes:
    - application/json
  parameters:
    - name: body
      in: body
      required: true
      schema:
        id : toto
        required:
          - first
          - last
        properties:
          first:
            type: string
            description: Unique identifier representing a First Name
          last:
            type: string
            description: Unique identifier representing a Last Name
  responses:
    200:
      description: creation OK
  </code></pre>
  
  <p>But the parameters doesnt appear on the swagger html page.
  And i dont know what the issue is on this...</p>
  
  <p>Thanks for your help.</p>