DRF Ecosystem Compatibility Boundaries
VUEDA's server builds on DRF, django-filter, drf-flex-fields2, and drf-writable-nested. Its defaults change some of their behavior. A client written for plain DRF meets different parameter names, stricter validation, and different response bodies. This page lists each departure briefly and links the page that describes it.
Query Parameter Names
DRF's DRF: SearchFilter and DRF: OrderingFilter read search and ordering by default, and drf-flex-fields2 reads expand, fields, and omit. VUEDA sets short names for these and for pagination and column totals: s, o, p, ps, e, f, om, and ct. These are the Wire Query Parameters. The client holds each name as a constant, so a rename on the server needs the same change on the client. Configuration Surface and Defaults lists each name with its server setting and client constant.
Default Filter Backends
DRF configures no filter backend by default. VUEDA's REST_FRAMEWORK defaults run three on every list endpoint, in this order:
- VuedaOrderingFilter extends
OrderingFilter. It applies a view's nulls placement to requested ordering, and it accepts every field in the view's default ordering as anovalue. - VuedaSearchFilterBackend extends
SearchFilterwith the search prefixes#(trigram similarity),~(word similarity), andV:(ranked search). It runs after ordering so that ordering does not reorder ranked results. A search field that reaches through a many-valued relation matches inside a subquery, built from the model's default manager or the viewset'sget_search_queryset().SearchFilterinstead copies the viewset's queryset, filters and aggregates included. Search through a many-valued relation describes the rule. - django-filter's
DjangoFilterBackendapplies the viewset'sfilterset_class.
A viewset that sets its own filter_backends replaces this list. Filtering and Ordering Semantics describes each backend's rules.
Unknown Input Returns 400
DRF ignores query parameters that a view does not read and request body keys that a serializer does not declare. VUEDA answers both with a 400 validation error that names the valid choices:
- NoExtraFieldsForViewSetMixin, part of VuedaViewSet and VuedaReadOnlyViewSet, rejects any query key that
listorretrievedoes not accept. It also rejectsfandevalues that name no field or expand. Filtering and Ordering Semantics describes these validation rules. - NoExtraFieldsSerializerMixin, part of VuedaSerializer, rejects top-level body keys that the serializer does not declare. It checks only the view's own serializer class, so keys inside a nested payload are not checked. Error and Validation Contract describes the error body.
A typo or a stale client gets an error that names the valid keys. An integration that adds its own query parameters or body keys fails until the viewset or serializer declares them.
Response Bodies and Authentication
VUEDA's defaults change these responses and the accepted credentials:
- List pagination. VUEDAPageNumberPagination returns
results,columnTotals,perPage,totalPages, andtotalRecords. DRF's DRF: PageNumberPagination returnscount,next,previous, andresults. Expose Aggregates inlistResponses describescolumnTotals. - Error bodies. core.exceptions.debug_stack_exception_handler moves a list of errors under
non_field_errors, and returns a JSON500for exceptions that DRF does not handle. It addsserverStackto every error body, except the409of Warning Confirmation. Error and Validation Contract describes these shapes. - Durations. When a
timedeltareaches VuedaJSONRenderer, the renderer writes it as a number of seconds. DRF's renderer writes a string. This affects values that bypass serializer fields, such as a duration column total. A serializerDurationFieldstill returns its string form. - Authentication. DRF's DRF: SessionAuthentication is the only authentication class. A client sends the session cookie, and writes also need the CSRF token.
Registration Gates Model Info
In plain DRF, a viewset and a router entry give a model its REST API. VUEDA's Model Info endpoints also require the model's Canonical Registration through info.registration. A model with a viewset but no registration has a REST API but no model info, which the default UI needs to build its views. Canonical Registration and Model Discovery describes registration.
Flex Fields with Nested Writes
VuedaSerializer combines drf-flex-fields2 expansion with drf-writable-nested writes. Field and Expand Semantics describes Expand and Sparse Fields. Nested Write Compatibility describes what changes when the two packages share one serializer.
Composite Primary Keys
VuedaSerializer maps Django's Django: CompositePrimaryKey to CompositePrimaryKeyField without a field declaration. VuedaViewSet.get_object reads the key from the URL as a JSON list. Set Up CRUD for a Composite Primary Key Model gives the URL format and how to pass the key to Django: reverse.