Open JFQueralt opened 4 years ago
@jeff-knurek I think we should provide different response content type for a number of selected API endpoints? I think CSV is really efficient with only 2D table data. For some endpoint like Environment, it's not really efficient to use CSV. Turn Environment response object to CSV is kind of awkward. My idea is we will select a list of available content type for each endpoints. JSON will be default available for all endpoint. If users want different format, they need to add it in request header.
good point. @JFQueralt what do you think? it seems like endpoints like /environment
are just for MAP, and wouldn't ever need to be anything but json. maybe it's only in some variation of the reports (#162) that we need different response formats?
@maingockien01 after quick discussion with @JFQueralt there is just a few endpoints that will use CSV format as output:
Also: the other 2 format types (XLS, HXL) aren't required for these endpoints either
After @YehualashetGit 's PR for DSL endpoint is merged, you can already have a go at trying to implement that one to return the list in CSV format
❕ Problem description
Currently, our Open Data API offers only responses in JSON format. This may not be the most adequate format for data analysis in certain scenarios.
To offer better, standard formats to extract the RAW data from Project Lockdown.
💡 Proposed solution
For each public endpoint, (see documentation ), there should be an option to provide
format
to the API request parameters, in order to obtain the following formats:CSV
XLS
HXL
See Format documentation below for details on each format.
Definition of Done
📚 Resources
Project documentation
API Technical documentation
Format documentation