-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc in blueprint still documents entire app #35
Comments
@mpandzo Are you still there? I want to confirm that what you talk about is blueprint scoped swagger? test.py: from sanic import Sanic
from sanic.response import text
from bp import bp
app = Sanic()
app.static('/license', './LICENSE')
app.blueprint(bp)
@app.get('/')
def version(request):
return text('0.0.1')
if __name__ == '__main__':
app.run() bp.py: from sanic import Blueprint
from sanic.response import text
from sanic_openapi import swagger_blueprint
blueprint = Blueprint('bp')
bp = Blueprint.group(blueprint, swagger_blueprint, url_prefix='/bp/')
@blueprint.get('')
def bp_echo(request):
return text('foo') Do you only want to see |
Faced with same problem: from sanic import Sanic
from sanic.response import text
from bp import bp_public, bp_internal
app = Sanic()
app.static('/license', './LICENSE')
app.blueprint(bp_public) # Swagger should process only this blueprint
app.blueprint(bp_internal) # Swagger should ignore this blueprint
@app.get('/')
def version(request):
return text('0.0.1')
if __name__ == '__main__':
app.run() For now, it's impossible to hide |
Yep, it is impossible currently because Some possible solutions:
|
Even though document calls are only done in a blueprint, say a blue print with url prefix /bp/, swagger goes ahead and documents everything including routes in the root.
Is there a way to register or restrict the documenting for only the blueprint prefix?
The text was updated successfully, but these errors were encountered: