{"action":"created","issue":{"url":"https://api.github.com/repos/zettaapi/zetta-sdk-android/issues/3","repository_url":"https://api.github.com/repos/zettaapi/zetta-sdk-android","labels_url":"https://api.github.com/repos/zettaapi/zetta-sdk-android/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/zettaapi/zetta-sdk-android/issues/3/comments","events_url":"https://api.github.com/repos/zettaapi/zetta-sdk-android/issues/3/events","html_url":"https://github.com/zettaapi/zetta-sdk-android/issues/3","id":158436003,"number":3,"title":"Changing the library code breaks the public API at the moment","user":{"login":"blundell","id":655860,"avatar_url":"https://avatars.githubusercontent.com/u/655860?v=3","gravatar_id":"","url":"https://api.github.com/users/blundell","html_url":"https://github.com/blundell","followers_url":"https://api.github.com/users/blundell/followers","following_url":"https://api.github.com/users/blundell/following{/other_user}","gists_url":"https://api.github.com/users/blundell/gists{/gist_id}","starred_url":"https://api.github.com/users/blundell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blundell/subscriptions","organizations_url":"https://api.github.com/users/blundell/orgs","repos_url":"https://api.github.com/users/blundell/repos","events_url":"https://api.github.com/users/blundell/events{/privacy}","received_events_url":"https://api.github.com/users/blundell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zettaapi/zetta-sdk-android/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-03T19:18:49Z","updated_at":"2016-06-03T21:54:59Z","closed_at":null,"body":"With our parsing objects being public it means that if we change the parsing we change the signature of the public objects. This is really bad for compatibility and maintainability issues.\r\n\r\nThis class is an example of a parsing object and a publicly accessible object: https://github.com/zettaapi/zetta-sdk-android/blob/master/zettakit/src/main/java/com/apigee/zettakit/ZIKRoot.java\r\n\r\nThis could be fixed by having two layers:\r\n\r\n```\r\nclass ApiZikRoot {\r\n    @Nullable private ZIKLink href;\r\n    @Nullable private ArrayList<ZIKLink> links;\r\n    @Nullable private ArrayList<HashMap> actions;\r\n\r\n    @Nullable @JsonProperty(\"links\")\r\n    public ArrayList<ZIKLink> getLinks() {\r\n        return this.links;\r\n    }\r\n\r\n   ...\r\n```\r\n\r\nand \r\n\r\n```\r\npublic class ZikRoot {\r\n    private final ZIKLink href;\r\n    private final List<ZIKLink> links;\r\n    private final List<HashMap> actions;\r\n\r\n    public ArrayList<ZIKLink> getLinks() {\r\n        return this.links;\r\n    }\r\n...\r\n```\r\n\r\n`ApiZikRoot` would be the api json parsed into an objects then we convert it to our public api `ZikRoot` for public consumption.\r\n\r\n```\r\nZikLink href = apiZikRoot.getHref();\r\nList<ZikLink> links = apiZikRoot.getLinks();\r\nList<HashMap> actions = apiZikRoot.getActions();\r\nreturn new ZikRoot(href, links, actions);\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/zettaapi/zetta-sdk-android/issues/comments/223704096","html_url":"https://github.com/zettaapi/zetta-sdk-android/issues/3#issuecomment-223704096","issue_url":"https://api.github.com/repos/zettaapi/zetta-sdk-android/issues/3","id":223704096,"user":{"login":"RobertWalsh","id":1379821,"avatar_url":"https://avatars.githubusercontent.com/u/1379821?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertWalsh","html_url":"https://github.com/RobertWalsh","followers_url":"https://api.github.com/users/RobertWalsh/followers","following_url":"https://api.github.com/users/RobertWalsh/following{/other_user}","gists_url":"https://api.github.com/users/RobertWalsh/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertWalsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertWalsh/subscriptions","organizations_url":"https://api.github.com/users/RobertWalsh/orgs","repos_url":"https://api.github.com/users/RobertWalsh/repos","events_url":"https://api.github.com/users/RobertWalsh/events{/privacy}","received_events_url":"https://api.github.com/users/RobertWalsh/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T21:54:59Z","updated_at":"2016-06-03T21:54:59Z","body":"Also @Nullable and @NonNull are for users of the SDK to warn them when they need to watch out for null vars.  They should be annotated in every single class IMO."}}
{"actor":{"display_login":"RobertWalsh"}}