apidoc updates
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
from flask import Blueprint
|
||||
from flask_jwt_extended import jwt_required
|
||||
from flask_apispec import use_kwargs, marshal_with, doc
|
||||
from flask_apispec import use_kwargs, marshal_with
|
||||
|
||||
from api.exceptions import NotFoundException
|
||||
from api.utils import docwrap
|
||||
|
||||
from .models import TargetExchange
|
||||
from .serializers import target_exchange_schema, target_exchanges_schema
|
||||
|
||||
blueprint = Blueprint('target_exchange', __name__)
|
||||
doc = docwrap('TargetExchange')
|
||||
|
||||
|
||||
@doc(tags=['TargetExchange'])
|
||||
@doc
|
||||
@blueprint.route('', methods=['GET'])
|
||||
@jwt_required()
|
||||
@marshal_with(target_exchanges_schema)
|
||||
@@ -18,7 +20,7 @@ def get_list():
|
||||
return TargetExchange.query.all()
|
||||
|
||||
|
||||
@doc(tags=['TargetExchange'])
|
||||
@doc
|
||||
@blueprint.route('', methods=['POST'])
|
||||
@jwt_required()
|
||||
@use_kwargs(target_exchange_schema)
|
||||
@@ -29,7 +31,7 @@ def create(name):
|
||||
return target_exchange
|
||||
|
||||
|
||||
@doc(tags=['TargetExchange'])
|
||||
@doc
|
||||
@blueprint.route('/<exchange_id>', methods=['GET'])
|
||||
@jwt_required()
|
||||
@marshal_with(target_exchange_schema)
|
||||
@@ -41,7 +43,7 @@ def get_by_id(exchange_id):
|
||||
return NotFoundException(__name__)
|
||||
|
||||
|
||||
@doc(tags=['TargetExchange'])
|
||||
@doc
|
||||
@blueprint.route('/<exchange_id>', methods=['PUT'])
|
||||
@jwt_required()
|
||||
@use_kwargs(target_exchange_schema)
|
||||
|
||||
Reference in New Issue
Block a user