javaee-esprit / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Throw exception if required content is missing #692

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For example from:
https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest

insert: {
id: "calendar.calendars.insert",
path: "calendars",
httpMethod: "POST",
description: "Creates a secondary calendar.",
request: {
$ref: "Calendar"
},
response: {
$ref: "Calendar"
},
scopes: [
"https://www.googleapis.com/auth/calendar"
]
},

Note that calendar.calendars.insert has a Calendar request body.  Currently if 
the Calendar body parameter is null, the Java client library silently accepts 
it, but the Calendar API responds with an error message "Required" but doesn't 
specify that the Calendar content is missing.  This is a poor developer 
experience.

Instead, we should throw an exception if the content is missing.  In fact, 
anywhere where there is a request body specified in the discovery document, we 
should assume the content is required.

Original issue reported on code.google.com by yan...@google.com on 20 Dec 2012 at 10:43

GoogleCodeExporter commented 9 years ago
Clarification: the request content is required if and only if there is a schema 
parameter that is required in the request content.  In that sense this is very 
closely related to issue 466 "Throw exception if a required schema parameter is 
not specified".

Original comment by yan...@google.com on 8 Jan 2013 at 3:15

GoogleCodeExporter commented 9 years ago
https://codereview.appspot.com/7070060/

Original comment by rmis...@google.com on 18 Jan 2013 at 6:30

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 9 Feb 2013 at 1:25

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 11 Feb 2013 at 4:38