Skip to content

Commit 7042733

Browse files
committed
Base path dynamic
1 parent 897ea39 commit 7042733

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

project/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ def create_app():
3232

3333
app = connexion.App(__name__, specification_dir='./swagger/')
3434
# app.app.json_encoder = encoder.JSONEncoder
35-
app.add_api('swagger.yaml', arguments={'title': 'Swagger Example Project'})
36-
3735
application = app.app
36+
app.add_api('swagger.yaml',
37+
arguments={'title': 'Swagger Example Project'},
38+
base_path=application.config["APPLICATION_ROOT"])
39+
40+
3841
application.config.from_object(CONFIG[environment])
3942
db.init_app(application)
4043

project/swagger/swagger.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
---
22
swagger: "2.0"
33
info:
4-
description: "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters."
4+
description: "This is a sample server Color server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters."
55
version: "1.0.0"
6-
title: "Swagger Petstore"
6+
title: "Swagger Color list"
77
termsOfService: "http://swagger.io/terms/"
88
contact:
99
email: "apiteam@swagger.io"
1010
license:
1111
name: "Apache 2.0"
1212
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
13-
basePath: "/template"
1413
tags:
1514
- name: "colors"
1615
description: "Everything about your colors"

0 commit comments

Comments
 (0)