Uncouple all flask functions from base code.

removed test_decorators and test_parameter (this test is useless now);
removed the request/response containers and add new request response classes;
created a abstract api class and a api flask class;
derived classes will implements the get_response/get_request methods that will convert framework req/resp types to connexion req/resp types;
moved the jsonifier from produces to flask api;
created a abstract app class and a app flask class;
changed all validators to use the ConnexionRequest instead flask request;
changed the problem function to generate a ConnexionRequest;
created a new user variables container called context (this is a property of ConnexionRequest). this will be passed as kwargs to all operations functions;
this context is used on authentication;
fixed all tests to new API;
some changes that I did may not be documented in this commit.
This commit is contained in:
Diogo
2017-01-31 10:47:14 -02:00
parent 306731522a
commit 5857dd237f
48 changed files with 589 additions and 510 deletions

View File

@@ -49,7 +49,7 @@ def delete_pet(pet_id):
logging.basicConfig(level=logging.INFO)
db_session = orm.init_db('sqlite:///:memory:')
app = connexion.FlaskApp(__name__)
app.add_api('swagger.yaml', connexion.apis.FlaskApi)
app.add_api('swagger.yaml')
application = app.app