pypi flasgger 0.6.4
template_file

latest releases: 0.9.7.2.dev2, 0.9.7.2.dev1, 0.9.7.2.dev0...
6 years ago

added support for template file argument.

having this yaml

definitions:
  Data:
    type: object
    properties:
      _id:
        type: string

paths:
  /cv:
    put:
      parameters:
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/Data'
      responses:
        200:
          description: |
            Please wait the calculation, you'll receive an email with results
    delete:
      parameters:
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/Data'
      responses:
        200:
          description: |
            Please wait the calculation, you'll receive an email with results
    post:
      responses:
        200:
          description: done

You can now load in

from flask import Flask
from flasgger import Swagger


app = Flask(__name__)
Swagger(app, template_file='test.yaml')


@app.route('/cv', methods=['POST', 'PUT', 'DELETE'])
def cv():
    """
    Micro Service Based API for CV operations
    This API is for job to CVs matching operations
    """


app.run(debug=True)

and get

fqjskcb

Don't miss a new flasgger release

NewReleases is sending notifications on new releases.