Users would like to use REST APIs to download pipeline JSONs automatically through tooling that they build for CI/CD.
Currently, this is not possible, because the format that the Export functionality in CDAP returns is not available through any API in CDAP. This happens because the API to deploy a pipeline (POST .../apps) expects a different JSON structure in the request body than the structure that the API that returns the application's details in the response body (GET .../apps/[app-id]).
A couple of changes need to happen to fix this discrepancy:
1. The structure of the two JSONs above should be made similar, in a backward-compatible manner (one change would be to add a configuration field that duplicates the config field in the request JSON for the deploy API, but other changes should be verified).
2. The UI should be changed to not have any custom logic in the Export button, but to simply return the output of the (GET .../apps/[app-id]) API. This API returns more information (programs, datasets, etc) than the Export functionality, so whether the API needs a parameter to filter out that information is something that needs to be discussed also.