Skip to content

luhonghai/drf-json-logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

drf-custom-json-api

This library is extended from https://github.com/django-json-api/django-rest-framework-json-api

We customize the response of pagination from:

   {
       "links": {
           "prev": "http://example.com/api/1.0/identities",
           "self": "http://example.com/api/1.0/identities?page=2",
           "next": "http://example.com/api/1.0/identities?page=3",
       },
       "data": [{
           "type": "identities",
           "id": 3,
           "attributes": {
               "username": "john",
               "full-name": "John Coltrane"
           }
       }],
       "meta": {
           "pagination": {
             "count": 20
           }
       }
   }

to:

   {
       "data": [{
           "type": "identities",
           "id": 3,
           "attributes": {
               "username": "john",
               "full-name": "John Coltrane"
           }
       }],
       "meta": {
           "pagination": {
             "count": 20
           },
           "links": {
               "prev": "http://example.com/api/1.0/identities",
               "self": "http://example.com/api/1.0/identities?page=2",
               "next": "http://example.com/api/1.0/identities?page=3",
           },
       }
   }

Releases

No releases published

Packages

No packages published

Languages