This is the last release supporting Python 3.7, Django 3.2, Django 4.0, Django 4.1 and Django REST framework 3.13.
Added
* Added support for Python 3.11.
* Added support for Django 4.2.
* Added `400 Bad Request` as a possible error response in the OpenAPI schema.
Changed
* Added support to overwrite serializer methods in customized schema class
* Adjusted some still old formatted strings to f-strings.
* Replaced `OrderedDict` with `dict` which is also ordered since Python 3.7.
* Compound document "include" parameter is only included in the OpenAPI schema if serializer
implements `included_serializers`.
* Allowed overwriting of resource id by defining an `id` field on the serializer.
Example:
python
class CustomIdSerializer(serializers.Serializer):
id = serializers.CharField(source='name')
body = serializers.CharField()
* Allowed overwriting resource id on resource related fields by creating custom `ResourceRelatedField`.
Example:
python
class CustomResourceRelatedField(relations.ResourceRelatedField):
def get_resource_id(self, value):
return value.name
* `SerializerMethodResourceRelatedField(many=True)` relationship data now includes a meta section.
* Required relationship fields are now marked as required in the OpenAPI schema.
* Objects in the included array are documented in the OpenAPI schema to possibly have additional
properties in their "attributes" and "relationships" objects.
Fixed
* Refactored handling of the `sort` query parameter to fix duplicate declaration in the generated OpenAPI schema definition
* Non-field serializer errors are given a source.pointer value of "/data".
* Fixed "id" field being added to /data/attributes in the OpenAPI schema when it is not rendered there.
* Fixed `SerializerMethodResourceRelatedField(many=True)` fields being given
a "reltoone" schema reference instead of "reltomany".
* Callable field default values are excluded from the OpenAPI schema, as they don't resolve to YAML data types.