Package: drf-json-api
Django REST Framework - JSON API================================A parser and renderer for `Django RESTFramework <http://www.django-rest-framework.org/>`__ that adds supportfor the `JSON API <http://jsonapi.org/>`__ specification.Build status: |Build Status|Does this work?---------------**This package is currently being actively developed**, but is notwidely used in production. If you find any problems when using thispackage, please create a bug report at the `issuetracker <https://github.com/kevin-brown/drf-json-api/issues>`__ so we can figure out how to fix it.How do I use this?------------------This is designed to be used as only a renderer and parser and does notprovide any additional functionality that may be expected by JSON API.Specific to a view(set)~~~~~~~~~~~~~~~~~~~~~~~.. code:: pythonfrom rest_framework import genericsfrom rest_framework_json_api.renderers import JsonApiRendererclass ExampleView(generics.ListAPIView):renderer_classes = (JsonApiRenderer, )The JSON API renderer is not limited to just list views and can be usedon any of the generic views. It supports viewsets as well as non-genericviews.All views~~~~~~~~~The JSON API renderer can be used on all views by setting it as adefault renderer... code:: python# ...REST_FRAMEWORK = {"DEFAULT_RENDERER_CLASSES": ("rest_framework_json_api.renderers.JsonApiRenderer","rest_framework.renderers.BrowsableAPIRenderer",# Any other renderers),"DEFAULT_PARSER_CLASSES": ("rest_framework_json_api.parsers.JsonApiParser","rest_framework.parsers.FormParser","rest_framework.parsers.MultiPartParser",# Any other parsers),}#...This may break the API root view of the `Default Router<http://www.django-rest-framework.org/api-guide/routers#defaultrouter>`__, soyou may want to instead apply it to your viewsets.What does this support?-----------------------The JSON API renderer supports all features of hyperlinked serializersand will normalize attributes such as the `urlfield <http://www.django-rest-framework.org/api-guide/settings#url_field_name>`__to match the JSON API specification.Introspected resource types~~~~~~~~~~~~~~~~~~~~~~~~~~~JSON API uses `resourcetypes <http://jsonapi.org/format/#document-structure-resource-types>`__to determine what relations exist and how to better side-load resourcesautomatically. It is recommended that resource types match the URLstructure of the API and use a plural form. The resource type isdetermined from the model, and is the plural form of the `verbose modelname <https://docs.djangoproject.com/en/dev/ref/models/options/#verbose-name-plural>`__.If a verbose name cannot be determined, the generic key\ ``data`` willbe used for the resource type.Hyperlinked relations~~~~~~~~~~~~~~~~~~~~~JSON API will detect hyperlinked relations and set up the `urltemplates <http://jsonapi.org/format/#document-structure-url-templates>`__to match the destinations and attribute names automatically.Nested serializers~~~~~~~~~~~~~~~~~~JSON API will render nested serializers to match the `compound documentspecification <http://jsonapi.org/format/#document-structure-compound-documents>`__.This will theoretically support any depth of nested serializers, butonly a single level is tested and supported.Pagination~~~~~~~~~~JSON API does not explicitly call out pagination within thespecification, but instead leaves it flexible for the developer toimplement. The JSON API renderer supports the default pagination providedby Django REST Framework by adding it to the top level "meta" element.  Thiscan be overriden by using a modified render, or a paginator that relies on aheader, such as `the Link header basedpaginator <https://github.com/kevin-brown/drf-link-pagination>`__.What this will not easily support---------------------------------Due to limitations within the JSON API specification, as well as a needto handle the most common easy cases, this JSON API renderer will notwork with all views. When designing views that work well with the JSONAPI specification, there are a few needs that you should keep in mind.Anything not related to rendering or parsing~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This package is only designed to be used as a renderer and parser anddoes not provide support for parts of the JSON API specification thatare not unique to the JSON API specification. This includes featuressuch as custom filtering of results and pagination that does not use theresponse body. Features such as side-loading of data using queryparameters are also not supported.Isn't JSON API being actively developed?----------------------------------------Yes it is, and we will try to keep this package as close to the runningspecification as possible. This means that things may break duringversion changes, and until JSON API becomes stable we cannot guaranteebackwards compatibility. Once JSON API stabilizes, a deprecation processwill be established to match the policies of the JSON API specification.Recommended packages--------------------This parser/renderer combination is only meant to be used as one of manypackages that can be grouped together to create an API that supports theJSON API specification.Pagination~~~~~~~~~~`The Link header basedpaginator <https://github.com/kevin-brown/drf-link-pagination>`__ willwork with the renderer provided by this package.JSON Patch~~~~~~~~~~JSON API recommends using JSON Patch for `PATCH` requests, and allowing partialupdates through the `PUT` HTTP method.  JSON Patch support is available forDjango REST Framework through a `third party package<https://github.com/kevin-brown/drf-json-patch`__ and should be compatible... |Build Status| image:: https://travis-ci.org/kevin-brown/drf-json-api.svg?branch=master:target: https://travis-ci.org/kevin-brown/drf-json-apiDocumentation-------------The full documentation is at http://drf-json-api.rtfd.org.History-------0.1.0 (Unreleased)~~~~~~~~~~~~~~~~~~* First release on PyPI.