Changelog¶
0.17.0 (2019-09-19)¶
Features:
- Backwards-incompatible: Only return status code and short name in error handler (#84).
- Backwards-incompatible: Remove logging from error handler. Logging can be
achieved in application code by overriding
handle_http_exception. Remove_prepare_error_response_content. Reponse payload is computed inhandle_http_exception. (#85) - Backwards-incompatible: Remove
InvalidLocationError. The mapping from webargs locations to OAS locations is done in apispec and no exception is raised if an invalid location is passed. (#81) - Add
content_typeargument toBlueprint.argumentsand provide reasonable default content type forformandfiles(#83). - Add
descriptionparameter toBlueprint.argumentsto pass description forrequestBody(#93). - Allow customization of docstring delimiter string (#49).
- Support file uploads as multipart/form-data (#97).
Bug fixes:
- Fix documentation of
formandfilesarguments: userequestBodyin OAS3, document content type (#83).
Other changes:
- Backwards-incompatible: Don’t republish
NestedQueryArgsParseranymore. This belongs to user code and can be copied from webargs doc (#94). - Backwards-incompatible: Bump minimum apispec version to 3.0.0.
0.16.1 (2019-07-15)¶
Bug fixes:
- Fix detection of unhandled exceptions in error handler for Flask=>1.1.0 (#82).
Other changes:
- Bump minimum Flask version to 1.1.0. From this version on, uncaught
exceptions are passed to the error handler as
InternalServerErrorwith the exception attached asoriginal_exceptionattribute. (#82)
0.16.0 (2019-06-20)¶
Features:
- Add
parametersargument toBlueprint.routeto pass documentation for parameters that are shared by all operations of a path (#78).
Other changes:
- Backwards-incompatible: Bump minimum apispec version to 2.0.0.
- Backwards-incompatible: Path parameters documentation passed in
Blueprint.docis no longer merged with automatic documentation. It should be passed inBlueprint.routeinstead. - Backwards-incompatible: Remove
Api.schemaandApi.definition. Those methods are useless sinceSchemacomponents are automatically registered by apispec. Manual component registration is still possible using the internal apispecComponentsobject. (#75)
0.15.0 (2019-05-09)¶
Features:
- Add parameters to pass examples and headers in
Blueprint.responsedecorator (#63). - Add parameters to pass examples for
requestBodyin OpenAPI v3 inBlueprint.argumentsdecorator (#68). - Support status codes expressed as
HTTPStatusinBlueprint.responsedecorator (#60). Thanks @Regzand for reporting.
Other changes:
- Bump minimum apispec version to 1.3.2.
- Bump minimum werkzeug version to 0.15. With 0.14.x versions, 412 responses are returned with no content.
- Backwards-incompatible: When using
Blueprint.docdecorator to provide additional documentation to the response described in theBlueprint.responsedecorator, the user must use the same format (str,intorHTTPStatus) to express the status code in both decorators. This is a side-effect of (#60). Now that headers and examples can be described inBlueprint.response, this should not be a common use case.
0.14.1 (2019-04-18)¶
Features:
- Official Python 3.7 support (#45).
- Rename
Api.definitionasApi.schema. KeepApi.definitionas an alias toApi.schemafor backward compatibility (#53).
Bug fixes:
- Fix passing route with path parameter default value (#58). Thanks @zedrdave for reporting.
- When no descrition is provided to
Blueprint.response, don’t add an empty string as description in the docs. - Fix returning a
tuplesubclass from a view function. Only rawtupleinstances are considered as Flask’s (return value, status, headers).tuplesubclasses are treated aslistand can be paginated/dumped. Rawtuplereturn values should be cast to another type (e.g.list) to be distinguished from (return value, status, headers) tuple. (#52) Thanks @asyncee for reporting.
0.14.0 (2019-03-08)¶
Features:
- Allow view functions decorated with
responseto return aResponseobject or a tuple with status and/or headers (#40). - Allow view functions decorated with
paginateto return a tuple with status and/or headers (#40). The pagination header is now passed in the response tuple. Users relying on undocumentedget_context()['headers']as a workaround to pass headers must update their code to pass headers in the response tuple as well.
Bug fixes:
- Fix ETag computation when headers contain a duplicate key.
0.13.1 (2019-02-13)¶
Features:
- Register Werkzeug’s
UUIDConverterinApiso thatuuidpath parameters are correctly documented.
0.13.0 (2019-02-12)¶
Features:
- Add
flask_pluginandmarshmallow_pluginspec kwargs to allow overriding base plugins. - Backwards-incompatible: Rename
pluginsspec kwarg intoextra_plugins. - Backwards-incompatible: Don’t default to OpenAPI version 2.0. The version
must now be specified, either as
OPENAPI_VERSIONapp parameter or asopenapi_versionspec kwarg. - Support apispec 1.0.0.
- Backwards-incompatible: Drop support for apispec 0.x.
0.12.0 (2018-12-02)¶
Features:
- Backwards-incompatible:
Api.register_converterdoesn’t register converter in Flask app anymore. It should be registered manually usingapp.url_map.converters['converter_name'] = Converter. Api.definition,Api.register_fieldandApi.register_convertercan be called before app initialization. The information is buffered and passed to the internalAPISpecobject when it is created, inApi.init_app.
0.11.1 (2018-11-20)¶
Features:
- The
HTTP_METHODSlist that defines the order of the methods in the spec is now a class attribute ofBlueprint. It can be overridden to enforce another order.
Bug fixes:
- Import
Mappingfromcollections.abcrather thancollections. The latter is deprecated in Python 3.7 and will be removed in 3.8. - Merge manual doc added with
Blueprint.docwith automatic documentation after auto doc is prepared (i.e. adapted to OpenAPI version) (#19). Thanks @fbergroth for reporting. - Merge automatic path parameter documentation with existing manual doc rather than append as duplicate parameter (#23). Thanks @congenica-andrew for reporting.
- Fix path parameter documentation structure when using OpenAPI v3.
- Document http status codes as strings, not integers.
- Fix use of Swagger UI config parameter
OPENAPI_SWAGGER_UI_URL.
Other changes:
- 100% test coverage !
0.11.0 (2018-11-09)¶
Features:
- Backwards-incompatible: Rework of the ETag feature. It is now accesible
using dedicated
Blueprint.etagdecorator.check_etagandset_etagare methods ofBlueprintandetag.INCLUDE_HEADERSis replaced withBlueprint.ETAG_INCLUDE_HEADERS. It is enabled by default (only on views decorated withBlueprint.etag) and disabled withETAG_DISABLEDapplication configuration parameter.is_etag_enabledis now private. (#21) - Backwards-incompatible: The
responsedecorator returns aResponseobject rather than a (Responseobject, status code) tuple. The status code is set in theResponseobject. - Support apispec 1.0.0b5.
0.10.0 (2018-10-24)¶
Features:
- Backwards-incompatible: Don’t prefix all routes in the spec with
APPLICATION_ROOT. If using OpenAPI v2, setAPPLICATION_ROOTasbasePath. If using OpenAPI v3, the user should specifyserversmanually. - Backwards-incompatible: In testing and debug modes,
verify_check_etagnot only logs a warning but also raisesCheckEtagNotCalledErrorifcheck_etagis not called in a resource that needs it.
0.9.2 (2018-10-16)¶
Features:
Api.register_blueprintpasses**optionskeyword parameters toapp.register_blueprintto overrideBlueprintdefaults. Thanks @dryobates for the suggestion.
0.9.1 (2018-10-11)¶
Features:
- Support apispec 1.0.0b3.
Bug fixes:
- Fix crash when serving documentation at root of application. Thanks @fbergroth for the suggestion.
0.9.0 (2018-10-01)¶
Features:
- Backwards-incompatible: When pagination parameters are out of range, the API does not return a 404 error anymore. It returns a 200 code with an empty list and pagination metadata (#10).
- Backwards-incompatible: Remove dependency on python-dateutil. This is an optional marshmallow dependency. Whether it is needed to deserialize date, time, or datetime strings depends on the application.
- Rework internal features by using mixin classes. This makes the code cleaner and adds customization possibilities (#9).
- Backwards-incompatible:
DEFAULT_PAGINATION_PARAMETERSis a class attribute ofBlueprint. - Backwards-incompatible: When no
Pageclass is passed topagination, (i.e. when doing pagination in view function), the pagination parameters are passed as aPaginationParametersobject. The item count must be passed by setting it asitem_countattribute of thePaginationParametersobject. Theset_item_countfunction is removed. - The pagination header name can be configured by overriding
PAGINATION_HEADER_FIELD_NAMEclass attribute ofBlueprint. If set toNone, no pagination header is added to the response. - Backwards-incompatible: The
paginatedecorator doesn’t useNestedQueryFlaskParserby default. It is renamed asNestedQueryArgsParserand it can be used by overridingBlueprint.ARGUMENTS_PARSER. - Backwards-incompatible: Drop Flask 0.x support. Flask>=1.0 is now required.
- Default error handler is registered for generic
HTTPException. Other extensions may register other handlers for specific exceptions or codes (#12).
0.8.1 (2018-09-24)¶
Features:
- Add page (page number) to pagination metadata.
- Set produces and consumes root document attributes when using OpenAPI v2.
Bug fixes:
- Document body parameter correctly when using OpenAPI v3.
0.8.0 (2018-09-20)¶
Features:
- Add
API_SPEC_OPTIONSapp config parameter. Thanks @xalioth for the suggestion. - Backwards-incompatible:
Apiaccepts aspec_kargsparameter, passed as kwargs to the internalAPISpecinstance.spec_pluginsis removed, plugins shall be passed asspec_kwargs={'plugins': [...]}. - Backwards-incompatible: Get summary and description from docstrings (#5).
- Add support for marshmallow 3.0.0b13. 2.x and 3b are now supported.
- Add support for apispec 1.0.0b2. 0.x and 1b are now supported.
Bug fixes:
0.7.0 (2018-07-19)¶
Other changes:
- Backwards-incompatible: Remove
_wrapper_classfromPage. Creating a custom pager is easier by just overridingPagemethods. - Backwards-incompatible: Let
OPENAPI_SWAGGER_UI_SUPPORTED_SUBMIT_METHODSdefault to “all methods” list.
0.6.1 (2018-06-29)¶
Bug fixes:
- Swagger UI integration: respect
OPENAPI_SWAGGER_UI_URLconfiguration paramater. Api.register_field: useAPISpec.register_fieldrather than accessself.spec.ma_plugindirectly.
0.6.0 (2018-06-29)¶
Features:
- Backwards-incompatible: Use apispec 0.39.0 plugin class interface.
- Backwards-incompatible: Expose APISpec’s
register_fieldandregister_converter methodsfromApiobject.Api.register_convertersignature is modified to makenameparameter optional. - Pass extra apispec plugins to internal APISpec instance.
- Backwards-incompatible: Drop official support for Python 3.4.
0.5.2 (2018-06-21)¶
Features:
- Pass OpenAPI version as
OPENAPI_VERSIONapp config parameter. - Add Swagger UI (3.x) integration.
0.5.0 (2018-06-05)¶
Features:
- Backwards-incompatible: In
Blueprint.route, the endpoint name defaults to the function name with the case unchanged. Before this change, the name was lowercased. - Backwards-incompatible: Pagination is now managed by dedicated
Blueprint.paginatedecorator. - Add
etag.INCLUDE_HEADERSto specify which headers to use for ETag computation (defaults to['X-Pagination']). - In
verify_check_etag, endpoint name is added to the warning message.
0.4.2 (2018-04-27)¶
Bug fixes:
- Pagination: don’t crash if
item_countis not set, just log a warning and set no pagination header. - API spec: Fix leading/trailing slash issues in api-docs Blueprint. Fixes compatibility with Flask 1.0.
0.4.1 (2018-04-17)¶
Features:
- Allow multiple calls to
Blueprint.argumentson a view function. - Enforce order of fields in
PaginationParametersSchemaandPaginationMetadataSchema. - Minor improvements in test_examples.py.
0.4.0 (2018-04-05)¶
Features:
- Backwards-incompatible: The case of a parameter both in URL and in arguments Schema is now unsupported.
- Backwards-incompatible: By default, Schema parameter passed in
Blueprint.argumentsis documented as required. - Backwards-incompatible:
APISpec.register_fieldnow uses apispec API. It must be passed a(type, format)couple or an already registeredFieldclass (this includes base marshmallowFields. When using(type, format),formatdoesn’t default toNoneanymore. - Preserve order when serving the spec file: - Fields are printed in declaration order if Schema.Meta.ordered is True - Methods in a method view are printed in this order: [‘OPTIONS’, ‘HEAD’, ‘GET’, ‘POST’, ‘PUT’, ‘PATCH’, ‘DELETE’] - Paths are added in declaration order
Bug fixes:
- Document response as array when using paginate_with.
0.3.0 (2018-03-02)¶
Features:
- Add leading and trailing
/to OPENAPI_URL_PREFIX if missing. - Backwards-incompatible: Change default URL path for OpenAPI JSON to
'openapi.json'.
Bug fixes:
- Fix OpenAPI docs URL paths.
- Backwards-incompatible:
Blueprint.route(self, rule, **options)matchesflask’sBlueprintsignature.
0.2.0 (2018-03-02)¶
Features:
formatparameter inregister_converterandregister_fieldis now optional and defaults toNone.- APISpec inherits from original apispec.APISpec.
- Backwards-incompatible: The internal
APISpecinstance is now exposed as public attributespecofApi.register_converterandregister_fieldare not proxied anymore byApiand must be called onspec. - Backwards-incompatible:
Api.register_convertertakes anameparameter and registers a converter in theFlaskapplication as well as in its internalAPISpecinstance. - Backwards-incompatible:
Api.register_spec_pluginis removed.api.register_spec_plugin(...)shall be replaced withapi.spec.setup_plugin(...).
0.1.0 (2018-02-16)¶
First release.