{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/122","labels_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/122/comments","events_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/122/events","html_url":"https://github.com/chrsmith/google-api-java-client/issues/122","id":59373410,"number":122,"title":"@JsonString for numbers","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-JSON","name":"Component-JSON","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Milestone-Version1.3.0","name":"Milestone-Version1.3.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":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-01T03:06:01Z","updated_at":"2015-03-01T03:06:01Z","closed_at":"2015-03-01T03:06:01Z","body":"```\nExternal references, such as a standards document, or specification?\n\nhttp://tools.ietf.org/html/rfc4627\n\nJava environments (e.g. Java 6, Android 2.2, App Engine 1.3.7, or All)?\n\nAll.\n\nPlease describe the feature requested.\n\nCurrently we assume that 64-bit numbers are represented as Strings in the JSON \nwire format.  The reasoning was that JavaScript clients cannot handle 64-bit \nnumbers properly, so they prefer numbers be stored as strings.  However, that \ndoesn't represent the most general use of JSON.  For example, OAuth 2 uses a \n64-bit JSON number for the \"expires_in\" field.\n\nThe problem is that then there is no way to parse 64-bit (and higher precision) \nJSON numbers.  Another problem: it is unintuitive that an int field is stored \nas a JSON number but a long field is stored as a JSON string.\n\nThe proposal is to instead always assume Java numbers are stored as JSON \nnumber.  If someone wants to store a Java number as a JSON string instead they \nmust add a new @JsonString annotation.\n\nFor example, this parses a JSON number:\n\n{\"value\" : 12345768901234576890123457689012345768901234576890}\n\nclass A {\n  @Key BigInteger value;\n}\n\nAnd this parses a JSON string:\n\n{\"value\" : \"12345768901234576890123457689012345768901234576890\"}\n\nclass B {\n  @Key @JsonString BigInteger value;\n}\n\nIf there is a mismatch between the declared Java field and the JSON value, the \nparser will throw an IllegalArgumentException.  This will happen for example if \none tries to use class A for the second example, or class B for the first \nexample.  This ensures that serialization of the data class matches the \noriginal parsed JSON data.\n```\n\nOriginal issue reported on code.google.com by `yan...@google.com` on 14 Feb 2011 at 4:19"},"comment":{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/comments/76566339","html_url":"https://github.com/chrsmith/google-api-java-client/issues/122#issuecomment-76566339","issue_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/122","id":76566339,"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},"created_at":"2015-03-01T03:06:01Z","updated_at":"2015-03-01T03:06:01Z","body":"```\nhttp://codereview.appspot.com/3989063/\n```\n\nOriginal comment by `yan...@google.com` on 14 Feb 2011 at 10:08\n* Changed state: **Started**\n* Added labels: **Component-JSON**"}}