Releases: marshmallow-code/flask-smorest
Releases · marshmallow-code/flask-smorest
0.15.1
0.15.0
Features:
- Add parameters to pass examples and headers in
Blueprint.response
decorator (:pr:63
). - Add parameters to pass examples for
requestBody
in OpenAPI v3 in
Blueprint.arguments
decorator (:pr:68
). - Support status codes expressed as
HTTPStatus
inBlueprint.response
decorator (:issue:60
).
Thanks :user: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.doc
decorator to provide
additional documentation to the response described in the
Blueprint.response
decorator, the user must use the same format (str
,
int
orHTTPStatus
) to express the status code in both decorators.
This is a side-effect of (:issue:60
). Now that headers and examples can
be described inBlueprint.response
, this should not be a common use case.
0.14.1
Features:
- Official Python 3.7 support (:pr:
45
). - Rename
Api.definition
asApi.schema
. KeepApi.definition
as an
alias toApi.schema
for backward compatibility (:pr:53
).
Bug fixes:
- Fix passing route with path parameter default value (:pr:
58
).
Thanks :user: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
tuple
subclass from a view function. Only rawtuple
instances are considered as Flask's (return value, status, headers).
tuple
subclasses are treated aslist
and can be paginated/dumped.
Rawtuple
return values should be cast to another type (e.g.list
)
to be distinguished from (return value, status, headers) tuple. (:issue:52
)
Thanks :user:asyncee
for reporting.
0.14.0
Features:
- Allow view functions decorated with
response
to return aResponse
object or a tuple with status and/or headers (:pr:40
). - Allow view functions decorated with
paginate
to return a tuple with
status and/or headers (:pr:40
). The pagination header is now passed
in the response tuple. Users relying on undocumented
get_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
0.13.0
Features:
- Add
flask_plugin
andmarshmallow_plugin
spec kwargs to allow
overriding base plugins. - Backwards-incompatible: Rename
plugins
spec kwarg into
extra_plugins
. - Backwards-incompatible: Don't default to OpenAPI version 2.0. The version
must now be specified, either asOPENAPI_VERSION
app parameter or as
openapi_version
spec kwarg. - Support apispec 1.0.0.
- Backwards-incompatible: Drop support for apispec 0.x.
0.12.0
Features:
- Backwards-incompatible:
Api.register_converter
doesn't register
converter in Flask app anymore. It should be registered manually using
app.url_map.converters['converter_name'] = Converter
. Api.definition
,Api.register_field
andApi.register_converter
can
be called before app initialization. The information is buffered and passed
to the internalAPISpec
object when it is created, inApi.init_app
.
0.11.2
0.11.1
Features:
- The
HTTP_METHODS
list 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
Mapping
fromcollections.abc
rather thancollections
. The
latter is deprecated in Python 3.7 and will be removed in 3.8. - Merge manual doc added with
Blueprint.doc
with automatic documentation
after auto doc is prepared (i.e. adapted to OpenAPI version) (:issue:19
).
Thanks :user:fbergroth
for reporting. - Merge automatic path parameter documentation with existing manual doc rather
than append as duplicate parameter (:issue:23
).
Thanks :user: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
Features:
- Backwards-incompatible: Rework of the ETag feature. It is now accesible
using dedicatedBlueprint.etag
decorator.check_etag
andset_etag
are methods ofBlueprint
andetag.INCLUDE_HEADERS
is replaced with
Blueprint.ETAG_INCLUDE_HEADERS
. It is enabled by default (only on views
decorated withBlueprint.etag
) and disabled withETAG_DISABLED
application configuration parameter.is_etag_enabled
is now private. - Backwards-incompatible: The
response
decorator returns aResponse
object rather than a (Response
object, status code) tuple. The status
code is set in theResponse
object. - Support apispec 1.0.0b5.