Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
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.
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
@Alvin Wang - 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.
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.