Djangorestframework-jsonapi

Latest version: v7.1.0

Safety actively analyzes 681775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

7.1.0

Fixed

* Handled zero as a valid ID for resource (regression since 6.1.0)
* Ensured that patching a To-Many relationship with the `RelationshipView` correctly raises request error when passing in `None`.
For emptying a To-Many relationship an empty array should be used as per [JSON:API spec](https://jsonapi.org/format/#crud-updating-to-many-relationships)

Added

* Added support for Django 5.1
* Added support for Python 3.13

Deprecated

* Deprecated built-in support for generating OpenAPI schema. Use [drf-spectacular-json-api](https://github.com/jokiefer/drf-spectacular-json-api/) instead.

7.0.2

Fixed

* Allow overwriting of url field again (regression since 7.0.0)
* Ensured that no fields are rendered when sparse fields is set to an empty value. (regression since 7.0.0)

7.0.1

Added

* Added `429 Too Many Requests` as a possible error response in the OpenAPI schema.

Fixed

* Ensured that URL and id field are kept when using sparse fields (regression since 7.0.0)

7.0.0

Added

* Added support for Python 3.12
* Added support for Django 5.0
* Added support for Django REST framework 3.15

Fixed

* Fixed OpenAPI schema generation for `Serializer` when used inside another `Serializer` or as a child of `ListField`.
* `ModelSerializer` fields are now returned in the same order than DRF
* Avoided that an empty attributes dict is rendered in case serializer does not
provide any attribute fields.
* Avoided shadowing of exception when rendering errors (regression since 4.3.0).
* Ensured that sparse fields only applies when rendering, not when parsing.
* Adjusted that sparse fields properly removes meta fields when not defined.

Removed

* Removed support for Python 3.7.
* Removed support for Django 3.2.
* Removed support for Django 4.0.
* Removed support for Django 4.1.
* Removed support for Django REST framework 3.13.
* Removed obsolete compat `NullBooleanField` and `get_reference` definitions.

6.1.0

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.

6.0.0

Fixed

* Fixed invalid relationship pointer in error objects when field naming formatting is used.
* Properly resolved related resource type when nested source field is defined.
* Prevented overwriting of pointer in custom error object
* Adhered to field naming format setting when generating schema parameters and required fields.

Added

* Added support for Django 4.1.
* Added support for Django REST framework 3.14.
* Expanded JSONParser API with `parse_data` method

Changed

* Improved documentation of how to override DRF's generateschema `--generator_class` to generate a proper DJA OAS schema.

Removed

* Removed support for Django 2.2.
* Removed support for Django REST framework 3.12.

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.