DINA-Web / guidelines

Guidelines on how to create, test and deploy modules within the DINA-project
2 stars 1 forks source link

Make properties in JSON responses consistent with key names in HTTP requests #3

Closed gnewton closed 9 years ago

gnewton commented 9 years ago

orderBy is used in the GET request (and others), but the same information is represented by 'sortColumn' in the corresponding JSON response. Example: GET /collectionobjects?orderby=ProjectNumber,InventoryDate&limit=100&offset=0

JSON response:

...
"sortColumn": "ID",
...

Suggest using orderBy in both HTTP request and in JSON response. Also decide on whether to use camel-case or not, and use the same in both.

Example. HTTP request: GET /collectionobjects?orderBy=ProjectNumber,InventoryDate&limit=100&offset=0

JSON response:

...
"orderBy": [
             "ProjectNumber",
             "InventoryDate"
          ],
...

NB Should check for other examples of this kind of inconsistency..

sdaume commented 9 years ago

+1

Could you update the document accordingly.

gnewton commented 9 years ago

Changes committed dfe43db