All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Make httpx version specification less restrictive
- Downgrade manifested openapi version to 3.0.3
- Update to openapi-pydantic 0.5.0
- Remove unexpected openapi attributes from path and query parameters
- Do not ignore unexpected openapi attributes anymore
- Fix openapi schema sharing for Page types
- Fix openapi schema sharing between optional and non-optional types
- Schemas extracted to OpenAPI components, are always referenced
- Better nullable handling in OpenAPI schemas
- Added support of Python 3.12
- Replaced openapi-schema-pydantic with openapi-pydantic
- Get rid of Configurer
- Bump dateutils and typing-extensions versions, drop Python 3.7 support
- Add
add_url_segment_as_tag
boolean parameter to generate_openapi function to disable adding url segment as tag in OpenAPI
- Add OpenAPI inspector for
@winter.web.query_parameters
case
- Add
@winter.web.query_parameters
decorator to inject query parameters into a single method argument
- Delete
winter_ddd.global_domain_event_dispatcher
- It's now application responsibility to configure
DomainEventDispatcher
- For convenience there are a number of methods in
DomainEventDispatcher
class to add handlers - It's not a final form as it requires a lot of manual effort and configuration, so more changes to come
- Add
EventPublisher.emit_many
method to emit multiple events at once - Refactor
EventDispatcher
to dispatch events as a list or as a single event depending on handler argument type
- get_previous_page_url and get_next_page_url fixed
- Vulnerability fix: remove the X-Forwarded-Host/X-Host header values from next/previous page links in Page response
- Generated OpenAPI JSON file now have no differences if generation is called multiple times
- DRF request and response are replaced with Django HttpRequest and HttpResponse
- Default Authorization and CSRF protection are removed from the framework
- Always encode decimals as strings despite COERCE_DECIMAL_TO_STRING setting
- Removed: JSONRenderer, create_django_urls_for_package, create_django_urls, @no_authentication, @csrf_exempt
- Removed djangorestframework from dependencies
- OpenAPI updated to version 3.0.3
- DRF serializers are not supported anymore, use dataclasses instead. Classes and annotations deleted: PageSerializer, BodyWithContext, @input_serializer, @output_serializer
- drf_yasg deleted from dependencies
- Fixed missing
collectionFormat
field in a OpenAPI schema for query array parameters
- Add winter.core.json.Undefined class to represent absence of value in JSON object
- @winter.web.csrf_exempt: fixed bug with csrf_exempt decorator for old views
- winter.core.module_discovery functions are now generators, package is no longer optional
- @winter.web.csrf_exempt: this decorator marks api class as being exempt from the protection ensured by the middleware
- Fixed specification of optional properties in OpenAPI schema for models, which used as input parameters
- Duplicate model names for different models don't appear in OpenAPI schema anymore -
PageMeta
renamed toPageMetaOf{PageName}
, models in input parameters now have the suffixInput
- winter_django.create_django_urls_from_routes: function that returns a list of django urls by the list of Routes
- winter.messaging: set frozen=true for Event class
- winter.web.throttling: function allows to reset the accumulated throttling state for a specific user and scope
- winter.web.find_package_routes: function that returns a list of routes by the package name
- winter.messaging: EventBus interface segregated and renamed to EventPublisher
- Fixed generation of the default parameter for
order_by
OpenAPI descriptions
- Long (multi-line) description from operation method docstring is included in the OpenAPI Operation description
- Docstrings for dataclasses and their attributes are converted to corresponding OpenAPI descriptions
- Python 3.6 is no longer supported
- Sequence added to json decoder
- Fixed but with dependency
- Fixed but with dependency
- winter.messaging: EventBus interface added, SimpleEventBus implemented
- Adjust response body to comply with RFC7807 when request data decoding fails
- get_all_subclasses function in module_discovery module
- Refactor ModuleDiscovery to functions
- Register ThrottleException as a global to simplify projects without throttling
- Add Swagger UI which do not rely on drf_yasg and static file server: winter_openapi.get_swagger_ui_html
- Delete @winter.web.controller
- Delete get_component function in favor of direct Component.get_by_cls
- Rename register_controller_method_inspector to register_route_parameters_inspector
- Rename MethodArgumentsInspector to RouteParametersInspector
- winter_openapi: add support of StrEnum: now StrEnum will be recognized as Enum, not as simple string
- winter_sqlalchemy add sort method: extract sort method from paginate to apply only order_by
winter_openapi: add more information about nested type to Page type title, for example Page[NestedType] -> PageOfNestedType
Return 400 Bad Request instead of 500 if UUID request parameter has a newline character in the end
Return 400 Bad Request instead of 500 if UUID request parameter is malformed
Fix cyclic imports caused by DRF importing external renderer classes during import
Generate titles for dataclass-generated openapi schemas
Fix bug in winter_openapi: nested required dataclass fields weren't marked as required.
Fix bug in winter_openapi: required dataclass fields weren't marked as required.
Change build system to poetry
Update sqlalchemy to 1.4.0+
- winter.core.ModuleDiscovery is added
- winter_django.autodiscovery.create_django_urls_for_package(package_name) is added
- get_injector() is called lazily
- global_domain_event_dispatcher now lazily loads injector which could be empty if importing too early
- CRUDRepository now supports custom implementation extensions
- set_factory changed to set_injector
- DomainEventDispatcher.set_handler_factory is deleted
- optional method argument added to interceptors
- winter.web now supports interceptors
- winter.web now supports configurers
- winter.web.set_controller_factory renamed to winter.web.set_factory
- winter_openapi add annotation @winter_openapi.global_exception
- winter_openapi add validation check for missing exceptions
- winter.web rename annotation @winter.throws → @winter.raises
- winter.web remove argument for problem annotation
auto_handle
and define default as True
- winter.web now supports problem annotation and handling exceptions accordingly with RFC7807
- Setting winter requires an explicit call to setup functions
- Fix building a django url pattern for methods with multiple parameters in url_path
- winter.web now supports Page-inherited classes. Extra fields are put to meta during serialization.
- process_domain_events replaced with global_domain_event_dispatcher.dispatch
- Add support for Union[Event1, Event2, ...] and List[Union[Event1, Event2, ...]] domain event handlers
- winter.pagination classes (Page, PagePosition, Order, Sort, SortDirection) moved to winter.data.pagination
- winter.json_encoder things (e.g. register_encoder) moved to winter.core.json
- winter.json_renderer.JSONRenderer moved to winter.django.drf.renderers.JSONRenderer
- winter.converters moved to winter.core.json.decoder
- argument_resolver, controller, output_processor are now part of winter.web. Import paths are preserved.
- winter.routing moved to winter.web.routing
- winter.exceptions moved to winter.web.exceptions
- PositiveInteger moved to winter.code.utils
- Move type_utils to winter.core.utils.typing
- Extract winter.schema to winter_openapi (winter_openapi.setup should be called manually now)
- Extract winter.drf and winter.django to winter_django (JSONRenderer moved to winter_django.renderers.JSONRenderer)