{"action":"opened","issue":{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/184","labels_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/184/comments","events_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/184/events","html_url":"https://github.com/chrsmith/google-api-java-client/issues/184","id":59360333,"number":184,"title":"Google API JSON error response","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Component-Google-APIs","name":"Component-Google-APIs","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Milestone-Version1.4.0","name":"Milestone-Version1.4.0","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Type-Enhancement","name":"Type-Enhancement","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-28T21:54:08Z","updated_at":"2015-02-28T21:54:08Z","closed_at":null,"body":"```\nExternal references, such as a standards document, or specification?\n\nhttp://code.google.com/apis/buzz/v1/using_rest.html#errors\n\nJava environments (e.g. Java 6, Android 2.3, App Engine 1.4.2, or All)?\n\nAll\n\nPlease describe the feature requested.\n\nGoogle APIs use a specific JSON error response format.  The library should have \na data class to help parse it.  It should look something like this:\n\npublic class ErrorResponse {\n @Key Error error;\n}\n\npublic class Error extends GenericJson {\n @Key ArrayList<ErrorInfo> errors;\n @Key int code;\n @Key String message;\n}\n\npublic class ErrorInfo extends GenericJson {\n @Key String domain;\n @Key String reason;\n @Key String message;\n @Key String location;\n @Key String locationType;\n}\n\nThen it could be used as in this example:\n\ntry {\n...\n} catch (HttpResponseException e) {\n ErrorResponse errorResponse = e.response.parseAs(ErrorResponse);\n ....\n}\n\n```\n\nOriginal issue reported on code.google.com by `yan...@google.com` on 18 Apr 2011 at 1:38"}}