{ "info": { "author": "Kevin Brown", "author_email": "kevin@kevinbrown.in", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "Django REST Framework - JSON API\n================================\n\nA parser and renderer for `Django REST\nFramework `__ that adds support\nfor the `JSON API `__ specification.\n\nBuild status: |Build Status|\n\nDoes this work?\n---------------\n\n**This package is currently being actively developed**, but is not\nwidely used in production. If you find any problems when using this\npackage, please create a bug report at the `issue\ntracker `__ so we can figure out how to fix it.\n\nHow do I use this?\n------------------\n\nThis is designed to be used as only a renderer and parser and does not\nprovide any additional functionality that may be expected by JSON API.\n\nSpecific to a view(set)\n~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n from rest_framework import generics\n from rest_framework_json_api.renderers import JsonApiRenderer\n\n\n class ExampleView(generics.ListAPIView):\n renderer_classes = (JsonApiRenderer, )\n\nThe JSON API renderer is not limited to just list views and can be used\non any of the generic views. It supports viewsets as well as non-generic\nviews.\n\nAll views\n~~~~~~~~~\n\nThe JSON API renderer can be used on all views by setting it as a\ndefault renderer.\n\n.. code:: python\n\n # ...\n REST_FRAMEWORK = {\n \"DEFAULT_RENDERER_CLASSES\": (\n \"rest_framework_json_api.renderers.JsonApiRenderer\",\n \"rest_framework.renderers.BrowsableAPIRenderer\",\n # Any other renderers\n ),\n \"DEFAULT_PARSER_CLASSES\": (\n \"rest_framework_json_api.parsers.JsonApiParser\",\n \"rest_framework.parsers.FormParser\",\n \"rest_framework.parsers.MultiPartParser\",\n # Any other parsers\n ),\n }\n #...\n\nThis may break the API root view of the `Default Router\n`__, so\nyou may want to instead apply it to your viewsets.\n\nWhat does this support?\n-----------------------\n\nThe JSON API renderer supports all features of hyperlinked serializers\nand will normalize attributes such as the `url\nfield `__\nto match the JSON API specification.\n\nIntrospected resource types\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nJSON API uses `resource\ntypes `__\nto determine what relations exist and how to better side-load resources\nautomatically. It is recommended that resource types match the URL\nstructure of the API and use a plural form. The resource type is\ndetermined from the model, and is the plural form of the `verbose model\nname `__.\n\nIf a verbose name cannot be determined, the generic key\\ ``data`` will\nbe used for the resource type.\n\nHyperlinked relations\n~~~~~~~~~~~~~~~~~~~~~\n\nJSON API will detect hyperlinked relations and set up the `url\ntemplates `__\nto match the destinations and attribute names automatically.\n\nNested serializers\n~~~~~~~~~~~~~~~~~~\n\nJSON API will render nested serializers to match the `compound document\nspecification `__.\nThis will theoretically support any depth of nested serializers, but\nonly a single level is tested and supported.\n\nPagination\n~~~~~~~~~~\nJSON API does not explicitly call out pagination within the\nspecification, but instead leaves it flexible for the developer to\nimplement. The JSON API renderer supports the default pagination provided\nby Django REST Framework by adding it to the top level \"meta\" element. This\ncan be overriden by using a modified render, or a paginator that relies on a\nheader, such as `the Link header based\npaginator `__.\n\n\nWhat this will not easily support\n---------------------------------\n\nDue to limitations within the JSON API specification, as well as a need\nto handle the most common easy cases, this JSON API renderer will not\nwork with all views. When designing views that work well with the JSON\nAPI specification, there are a few needs that you should keep in mind.\n\nAnything not related to rendering or parsing\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis package is only designed to be used as a renderer and parser and\ndoes not provide support for parts of the JSON API specification that\nare not unique to the JSON API specification. This includes features\nsuch as custom filtering of results and pagination that does not use the\nresponse body. Features such as side-loading of data using query\nparameters are also not supported.\n\nIsn't JSON API being actively developed?\n----------------------------------------\n\nYes it is, and we will try to keep this package as close to the running\nspecification as possible. This means that things may break during\nversion changes, and until JSON API becomes stable we cannot guarantee\nbackwards compatibility. Once JSON API stabilizes, a deprecation process\nwill be established to match the policies of the JSON API specification.\n\nRecommended packages\n--------------------\n\nThis parser/renderer combination is only meant to be used as one of many\npackages that can be grouped together to create an API that supports the\nJSON API specification.\n\nPagination\n~~~~~~~~~~\n\n`The Link header based\npaginator `__ will\nwork with the renderer provided by this package.\n\nJSON Patch\n~~~~~~~~~~\n\nJSON API recommends using JSON Patch for `PATCH` requests, and allowing partial\nupdates through the `PUT` HTTP method. JSON Patch support is available for\nDjango REST Framework through a `third party package\n