Bot releases are hidden (Show)
Published by greyli almost 3 years ago
Bugfix release:
Published by greyli about 3 years ago
Features:
extra_data
to abort
and HTTPError
, it accepts a dict that will be addedfrom apiflask import abort
@app.get('/')
def missing():
abort(404, message='nothing', extra_data={'code': '123', 'status': 'not_found'})
operation_id
in the doc
decorator (docs).@app.get('/')
@doc(operation_id='myCustomHello')
def hello():
pass
@output(links=...)
(docs).pet_links = {
'getAddressByUserId': {
'operationId': 'getUserAddress',
'parameters': {
'userId': '$request.path.id'
}
}
}
@app.post('/pets')
@output(PetOutSchem, links=pet_links)
def new_pet(data):
pass
add_url_rule
method on view classes.Undocumented breaking changes:
fields
, validators
, and Schema
in APIFlask.status_code
field from the default error response (#124).Published by greyli about 3 years ago
Breaking change:
HTTPError
object instead of individual error information:@app.error_processor
def my_error_processor(error):
return {
'status_code': error.status_code,
'message': error.message,
'errors': error.detail
}, error.status_code, error.headers
Features:
APIFlask.schema_name_resolver
attribute (docs).REDOC_CONFIG
:app.config['REDOC_CONFIG'] = {'disableSearch': True, 'hideLoading': True}
There are also some improvements on error handling, see the full changelog for more details: https://apiflask.com/changelog/#version-090
Published by greyli over 3 years ago
This is the first stable version. From this version, all breaking changes will start with a deprecated warning.
Some major changes in this version:
@app.get('/pets/<id>')
def get_pet(id):
pass
So user don't need to set a 404 response manually:
@app.get('/pets/<id>')
@doc(responses=[404])
def get_pet(id):
pass
app.spec
property now will always return the latest spec instead of the cached one (docs):>>> from apiflask import APIFlask
>>> app = APIFlask(__name__)
>>> app.spec
{'info': {'title': 'APIFlask', 'version': '0.1.0'}, 'tags': [], 'paths': OrderedDict(), 'openapi': '3.0.3'}
>>> @app.get('/')
... def hello():
... return {'message': 'Hello'}
...
>>> app.spec
{'info': {'title': 'APIFlask', 'version': '0.1.0'}, 'tags': [], 'paths': OrderedDict([('/', {'get': {'parameters': [], 'responses': OrderedDict([('200', {'content': {'application/json': {'schema': {}}}, 'description': 'Successful response'})]), 'summary': 'Hello'}})]), 'openapi': '3.0.3'}
>>>
INFO
(and app.info
attribute), it can be used to set the following info fields: description
, termsOfService
, contact
, license
(docs):app.info = {
'description': '...',
'termsOfService': 'http://example.com',
'contact': {
'name': 'API Support',
'url': 'http://www.example.com/support',
'email': '[email protected]'
},
'license': {
'name': 'Apache 2.0',
'url': 'http://www.apache.org/licenses/LICENSE-2.0.html'
}
}
AUTO_PATH_SUMMARY
-> AUTO_OPERATION_SUMMARY
AUTO_PATH_DESCRIPTION
-> AUTO_OPERATION_DESCRIPTION
See details in the changelog: https://github.com/greyli/apiflask/blob/main/CHANGES.md#version-080
Published by greyli over 3 years ago
Some major changes in this version:
flask spec
command to output the OpenAPI spec to stdout or a file (docs).SPEC_FORMAT
config. Remove the auto-detection of the format from APIFlask(spec_path=...)
(docs).See more in the changelog: https://github.com/greyli/apiflask/blob/main/CHANGES.md#version-070
Published by greyli over 3 years ago
Improve static request dispatch (https://github.com/greyli/apiflask/pull/54).
Published by greyli over 3 years ago
Fix static request dispatch issue for Flask 2.0 (https://github.com/greyli/apiflask/issues/52).
Published by greyli over 3 years ago
A bugfix release for Flask 2.0:
See the changelog for the details:
https://github.com/greyli/apiflask/blob/master/CHANGES.md#version-061
Published by greyli over 3 years ago
This release is mainly for Flask 2.0.
async def
that comes in Flask 2.0.Seet the changelog for more details.
Published by greyli over 3 years ago
A bugfix release.
Response
object in a view function decorated with output
decorator. In this case, APIFlask will do nothing but return it directly.Blueprint
objects when generating the OpenAPI specPublished by greyli over 3 years ago
A bugfix release.
Published by greyli over 3 years ago
The core feature added in this version is class-based views support. Check out the example application or documentation for more details.
This version also introduces some breaking changes:
DOCS_HIDE_BLUEPRINTS
, add APIBlueprint.enable_openapi
info.description
and tag description from the moduleAUTO_DESCRIPTION
config.flask.Bluerpint
and apiflask.APIBluerpint
.See the changelog for more details.
0.5.0 Changelog: https://github.com/greyli/apiflask/blob/master/CHANGES.md#version-050
Published by greyli over 3 years ago
This version introduces some breaking changes:
abort_json()
to abort()
.There are also some bug fixes and new features. Check out the changelog for the details.
0.4.0 Changelog: https://github.com/greyli/apiflask/blob/master/CHANGES.md#version-040
Published by greyli over 3 years ago
This is the first public version.
This version has some API change, public API changes including:
api_abort()
to abort_json()
.@doc(tags)
to @doc(tag)
.Besides, this version has basic type annotations for the package, the tests will be updated in the next version.
Check out the changelog for the details.
0.3.0 Changelog: https://github.com/greyli/apiflask/blob/master/CHANGES.md#version-030
Published by greyli over 3 years ago
From version 0.2.0, this project became a framework instead of a Flask extension. It provided two classes to replace the one in Flask:
flask.Flask
-> apiflask.APIFlask
flask.Blueprint
-> apiflask.APIBlueprint
This version also added some more useful features, a bunch of configuration variables, and changed almost all the APIs. Check out the changelog for the details.
Changelog: https://github.com/greyli/apiflask/blob/master/CHANGES.md#version-020
Published by greyli over 3 years ago
Based on APIFairy 0.6.3dev, version 0.1.0 added some useful features, check out the changelog for the details.