You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have system that is build with two API one is mine and another is third-part maintaned.
How can I add swagger without modify the source of the third-part software.
#restplus based artecture
from flask import Blueprint, render_template, abort, Flask
from jinja2 import TemplateNotFound
app = Flask(__name__)
other_page = Blueprint('other_page', __name__)
from flask_restplus import Api, Resource, fields
api = Api(other_page, version='1.0', title='Todo API',
description='A simple TODO API', doc='/doc/', template_folder='templates',
)
@api.route('/')
class TodoSimple(Resource):
def get(self):
try:
return render_template('other_page.html')
except TemplateNotFound:
abort(418)
simple.py
from flask import Flask
from simple_page import simple_page
from other_page import other_page
from flask_restplus import Api
app = Flask(__name__)
api = Api(simple_page, doc='/doc/')
app.register_blueprint(simple_page)
#app.register_blueprint(simple_page, url_prefix='/simple_page')
app.register_blueprint(other_page, url_prefix='/other_page')
app.run()
with this I get the doc page but a message "No operations defined in spec!".
And the rest_plus page I get the documentation normal.
The text was updated successfully, but these errors were encountered:
I have system that is build with two API one is mine and another is third-part maintaned.
How can I add swagger without modify the source of the third-part software.
I build a POC in the source below:
PoC
simple_page.py
other_page.py
simple.py
with this I get the doc page but a message "No operations defined in spec!".
And the rest_plus page I get the documentation normal.
The text was updated successfully, but these errors were encountered: