Google's API client libraries expect int64 and uint64 fields to be strings in JSON since Javascript itself can only handle (due to precision) integers up to 2**53.Īs you can see in the type-format documentation for Google's "Discovery" API standard, this is what to expect for these types. I can't seem to find any places where I actually have control over the serialization or deserialization, so how is this supposed to work with Java?Īs mentioned in another post, this is caused by a quirk of the protorpc library. E/AndroidRuntime( 9231): : number type formatted as a JSON number cannot use annotation Į/AndroidRuntime( 9231): at .Preconditions.checkArgument(Preconditions.java:119)Į/AndroidRuntime( 9231): at .(JsonParser.java:599)Į/AndroidRuntime( 9231): at .(JsonParser.java:350)Į/AndroidRuntime( 9231): at .(JsonParser.java:586)Į/AndroidRuntime( 9231): at .(JsonParser.java:456)Į/AndroidRuntime( 9231): at .(JsonParser.java:549)Į/AndroidRuntime( 9231): at .(JsonParser.java:289)Į/AndroidRuntime( 9231): at .(JsonObjectParser.java:76)Į/AndroidRuntime( 9231): at .(JsonObjectParser.java:71)Į/AndroidRuntime( 9231): at .(HttpResponse.java:495)Į/AndroidRuntime( 9231): at .(AbstractGoogleClientRequest.java:465)Į/AndroidRuntime( 9231): at .SyncAdapter.syncNotes(SyncAdapter.java:187)Į/AndroidRuntime( 9231): at .SyncAdapter.onPerformSync(SyncAdapter.java:110)Į/AndroidRuntime( 9231): at $n(AbstractThreadedSyncAdapter.java:254) This generates Java source that includes the attribute on the long fields, but when I get a response from the server, I get the following error. High_water_mark = messages.IntegerField(5) I've built my ProtoRPC message like this, using an Integer field for the object id, client_id and high_water_mark. I'm working on a Google Cloud Endpoint web service and after finally getting the auth to work, I'm having some issues with the generated code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |