Basic BrAPI framework
Implement new controller BrAPIController
mapped onto /brapi/v1
. It should use the standard OAuth2 authentication that is already implemented for existing /api/v0
.
http://docs.brapi.apiary.io/#introduction/structure-of-the-response-object:
BrAPI response
The response always consists of a "metadata" key that minimally contains the pagination information in a "pagination" key and the status information as well as a "datafiles" key that lists URLs to data files generated by the call.
If the response is a single record that doesn't require pagination, then the value for the "pagination" key is returned with all the keys set to zero. When the results are paginated, the keys "pageSize", "currentPage", "totalCount", "totalPages" contain the appropriate values. Note that pages are zero indexed, so the first page will be page 0 (zero). (For the user interface, this may be adjusted by adding 1).
The status object contains a list of objects with the keys "code" and "message". If no status is reported, the empty list should be returned.
The datafiles key contains a list of strings. The empty list should be returned if no datafiles are present.
The payload data is contained in a key called "result", containing an object with the response. If there is a paginated response, a "data" key will be present, with a list value, which will be paginated over (showing pageSize elements of the currentPage).
Additional documentation is in the GitHub wiki. See especially the [Best Practices and Conventions] (https://github.com/plantbreeding/documentation/wiki/Best-Practices-and-Conventions).