-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added contract swagger api not working due to werkzeug
- Loading branch information
Showing
13 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from flask import Blueprint, request | ||
|
||
blueprint = Blueprint('api', __name__, url_prefix='/api') | ||
|
||
|
||
@blueprint.route('/', methods=['GET']) | ||
def root(): | ||
return {'message': 'Root!'} | ||
|
||
|
||
@blueprint.route('/read_ocr', methods=['POST']) | ||
def read_ocr(): | ||
if request.method == "POST": | ||
return { | ||
'message': 'This endpoint should create an entity', | ||
'method': request.method, | ||
'body': request.json | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from flask import Blueprint | ||
from flask_restplus import Api | ||
from blueprints.documented_endpoints.hello_world import namespace as hello_world_ns | ||
|
||
blueprint = Blueprint('documented_api', __name__, url_prefix='/documented_api') | ||
|
||
api_extension = Api( | ||
blueprint, | ||
title='Flask RESTplus Demo', | ||
version='1.0', | ||
description='Application tutorial to demonstrate Flask RESTplus extension\ | ||
for better project structure and auto generated documentation', | ||
doc='/doc' | ||
) | ||
|
||
api_extension.add_namespace(hello_world_ns) |
Binary file added
BIN
+688 Bytes
blueprints/documented_endpoints/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added
BIN
+687 Bytes
blueprints/documented_endpoints/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from flask import request | ||
from flask_restplus import Namespace, Resource, fields | ||
|
||
namespace = Namespace('hello_world', 'Hello World related endpoints') | ||
|
||
hello_world_model = namespace.model('HelloWorld', { | ||
'message': fields.String( | ||
readonly=True, | ||
description='Hello world message' | ||
) | ||
}) | ||
|
||
hello_world_example = {'message': 'Hello World!'} | ||
|
||
|
||
@namespace.route('') | ||
class HelloWorld(Resource): | ||
|
||
@namespace.marshal_list_with(hello_world_model) | ||
@namespace.response(500, 'Internal Server error') | ||
def get(self): | ||
'''Hello world message endpoint''' | ||
|
||
return hello_world_example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ Pillow==8.2.0 | |
pytesseract==0.3.7 | ||
requests==2.25.1 | ||
urllib3==1.26.5 | ||
Werkzeug==2.0.1 | ||
Werkzeug==0.16.0 |