miLibris / flask-rest-jsonapi

Flask extension to build REST APIs around JSONAPI 1.0 specification.
http://flask-rest-jsonapi.readthedocs.io
MIT License
597 stars 153 forks source link

call self.init_app if Api was created with a app #74

Closed hellupline closed 6 years ago

hellupline commented 6 years ago

call self.init_app(app) on Api.__init__ to avoid external call for init_app when using Api(app) also by side-effect, solves the issue with PAGE_SIZE not set when not using init_app

current:

app = Flask(__name__)
api = Api(app)
api.init_app(app)  # required to avoid KeyError on app.config['PAGE_SIZE']

now:

app = Flask(__name__)
api = Api(app)
coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.01%) to 94.355% when pulling 070e33bf7a2ec0c860dec1cd42b8f7cfd6ce80e1 on hellupline:initialize-app into 6ab02abc5071e82babd104de7b2afbc59fa27037 on miLibris:master.

akira-dev commented 6 years ago

Thx