Breaking changes
- Removed public
OpenAPIView.dumpscustomization hook, #847
If you customized schema output forOpenAPIJsonView, subclass
the concrete view and override.get()instead.
For JSON output, usedmr.openapi.core.dump.json_dump
if you need the framework's default serializer - Breaking:
get_jwtis renamed torequest_jwt, #868 - Breaking:
ResponseSpecProvider.provide_response_specsis now
an instance method, #877 - Breaking: new required
routerparameter added
toEndpoint.get_schemaandController.get_path_item, #879
Migration Prompt
Apply this change to the code that uses `django-modern-rest`:
1. Replace `OpenAPIView.dumps` usage with `dmr.openapi.core.dump.json_dump`
usage
2. Change `dmr.security.jwt.auth.get_jwt` function
to use `dmr.security.jwt.auth.request_jwt` instead, if user expects
to always get a token back, add `strict=True` argument
3. Change `provide_response_specs` class method to be instance method,
replace all `cls` usage with `self`
4. Add `router: Router` parameter to `Endpoint.get_schema`
and `Controller.get_path_item` methodsFeatures
- Added official PyPy 3.11+ support, #870
- Added
dmr.throttlingpackage, #877 - Added
request.__drm_auth__on all successful auth workflows, #868 - Added
request_authhelper function, #868 - Added
AuthenticatedHttpRequesttype for better
request: AuthenticatedHttpRequest[User]
type annotations in controllers, #888 - Added
strictparameter torequest_rendererandrequest_parser,
added@overloads to both of these functions, #869 - Added
ResponseSpecMetadatatype to represent
headers and cookies with annotations, useful for error models, #882 - Allow individual
OpenAPIviews to skip schema validation, #867 - Added endpoint validator to prevent sync
and async generator HTTP endpoints, #843 - Added CSP-friendly templates for shipped
OpenAPIUI views, #847
SwaggerView,RedocView,ScalarView, andStoplightView
now avoid inline scripts in DMR-managed templates.
Final CSP compatibility still depends on the upstream renderer bundle. - Added
tagsanddeprecatedparameters toRouterfor OpenAPI metadata,
#872. All operations in a router can now be grouped and marked as deprecated.
Fixes
- Fixed that
OpenAPIwas revalidated on every.convertcall, #867 - Fixed missing
request.auser()afterJWTAsyncAuth, #884 - Fixed
ParameterMetadatamissing__slots__, #890 - Fixed
SSEventmissing__slots__, #901 - Fixed
SSEprotocol typing, #894 - Fixed a bug when we were treating controllers with
noapi_endpointsas non-abstract, #894 - Fixed a bug when you were not able to subclass
a controller with a serializer, #873
Misc
- Added
dmrskill for agents to write betterdjango-modern-restcode, #886 - Switched from
Maketojust
as a command runner
New Contributors
- @PNoryk made their first contribution in #879
- @Ai-chan-0411 made their first contribution in #900
- @drlinggg made their first contribution in #906
Full Changelog: 0.6.0...0.7.0