Consider changing Id.Program to be more flat instead of using ProgramRecord in HTTP response

Description

When transformed to JSON, Id.Program looks weird:

{ "application":{ "namespace":{"id":"someNamespace"}, "id":"SomeApp" }, "type":"FLOW", "id":"SomeProgram" }

We'd like it to look more like

{ "namespace":"someNamespace", "application":"SomeApp", "programType":"FLOW", "programId":"SomeProgram" }

Therefore we are currently using another class which is more flat, ProgramRecord, for displaying an Id.Program in an HTTP response more nicely. We should instead consider making Id.Program more flat like ProgramRecord, and then removing ProgramRecord.

Release Notes

None

duplicates

Activity

Show:

Alvin Wang October 21, 2015 at 10:27 PM

Ali Anwar July 23, 2015 at 9:47 PM

Also, seems like we can not use (a flat version) Id.Program in place of ProgramRecord in the HTTP responses, because we often return the description of the program as well.
ProgramRecord has description, but Id.Program does not have it. I also don't think it would be a good idea to put description into Id.Program, since that class should simply be the minimal identification for the program.

Relevant: seems like there is co.cask.cdap.proto.ProgramId (flat version of Id.Program), currently only used in Adapter endpoints.

Sreevatsan Raman July 23, 2015 at 9:39 PM

- can you add description on why we need this change.

Ali Anwar June 16, 2015 at 7:51 PM

I don't think this is necessary though; especially since all the other Id classes are not flat objects either.
Alternatively, is some sort of Serializer better than making the object flat?

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Priority

Created June 16, 2015 at 6:41 PM
Updated October 21, 2015 at 10:27 PM
Resolved October 21, 2015 at 10:27 PM