Skip to content

Commit

Permalink
Reproducing the import error of an external package (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
talitarossari authored and rochacbruno committed Jul 18, 2017
1 parent 506521a commit 1b2d600
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
5 changes: 5 additions & 0 deletions etc/flasgger_package/flasgger_package/parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
- in: path
name: username
type: string
required: true
29 changes: 27 additions & 2 deletions examples/package_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package.
"""

from flask import Flask
from flask import Flask, jsonify
from flasgger import Swagger
from flasgger_package import package_view

Expand All @@ -18,6 +18,32 @@
)


@app.route('/v2/decorated/<username>')
def package_view_2(username):
"""
This is the summary defined in yaml file
First line is the summary
All following lines until the hyphens is added to description
the format of the first lines until 3 hyphens will be not yaml compliant
but everything below the 3 hyphens should be.
---
tags:
- users
import: "flasgger_package/parameters.yml"
responses:
200:
description: A single user item
schema:
id: rec_username
properties:
username:
type: string
description: The name of the user
default: 'steve-harris 2'
"""
return jsonify({'username': username})


def test_swag(client, specs_data):
"""
This test is runs automatically in Travis CI
Expand All @@ -31,6 +57,5 @@ def test_swag(client, specs_data):
'/v1/decorated/{username}'
]['get']['tags']


if __name__ == "__main__":
app.run(debug=True)

0 comments on commit 1b2d600

Please sign in to comment.