Page MenuHomeSoftware Heritage

Add global filtering per fields on api endpoints
Closed, MigratedEdits Locked

Description

Permits the use of request parameter 'fields' to specify the fields to keep.
This is global on all api endpoints (across yaml renderer and json renderer).

For example, from standard call without anything:

curl -X GET http://localhost:6543/api/1/directory/3126f46e2f7dc752227131a2a658265e58f53e38
[
    {
      "dir_id": "3126f46e2f7dc752227131a2a658265e58f53e38",
      "name": "Makefile.am",
      "perms": 100644,
      "sha1": "b0283d8126f975e7b4a4348d13b07ddebe2cf8bf",
      "sha1_git": "e0522786777256d57c5210219bcbe8dacdad273d",
      "sha256": "897f3189dcfba96281b2190325c54afc74a42e2419c053baadfadc14386935ee",
      "status": "visible",
      "target": "e0522786777256d57c5210219bcbe8dacdad273d",
      "type": "file"
    },
    {
      "dir_id": "3126f46e2f7dc752227131a2a658265e58f53e38",
      "name": "Makefile.in",
      "perms": 100644,
      "sha1": "81f5757b9451811cfb3ef84612e45a973c70b4e6",
      "sha1_git": "3b948d966fd8e99f93670025f63a550168d57d71",
      "sha256": "f5acd84a40f05d997a36b8846c4872a92ee57083abb77c82e05e9763c8edb59a",
      "status": "visible",
      "target": "3b948d966fd8e99f93670025f63a550168d57d71",
          "type": "file"
    },
   ...
]

to:

curl -X GET http://localhost:6543/api/1/directory/3126f46e2f7dc752227131a2a658265e58f53e38?fields=name,perms,target,type
[
    {
      "name": "Makefile.am",
      "perms": 100644,
      "target": "e0522786777256d57c5210219bcbe8dacdad273d",
      "type": "file"
    },
    {
      "name": "Makefile.in",
      "perms": 100644,
      "target": "3b948d966fd8e99f93670025f63a550168d57d71",
       "type": "file"
    },
   ...
]

6448cb6

Event Timeline

ardumont claimed this task.
ardumont raised the priority of this task from to Normal.
ardumont updated the task description. (Show Details)
ardumont added a project: Web app.
ardumont added a subscriber: ardumont.
olasd changed the visibility from "All Users" to "Public (No Login Required)".May 13 2016, 5:07 PM