fer626 / google-api-java-client

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

Throw exception if a required schema parameter is not specified #466

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?

https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)?

All

Please describe the feature requested.

See this new annotation in the discovery document referenced above:

insert: {
id: "calendar.calendarList.insert",
path: "users/me/calendarList",
httpMethod: "POST",
description: "Adds an entry to the user's calendar list.",
request: {
$ref: "CalendarListEntry"
},
response: {
$ref: "CalendarListEntry"
},
scopes: [
"https://www.googleapis.com/auth/calendar"
]
},
...
CalendarListEntry: {
id: "CalendarListEntry",
type: "object",
properties: {
...
id: {
type: "string",
description: "Identifier of the calendar.",
annotations: {
required: [
"calendar.calendarList.insert",
"calendar.calendarList.update"
]
}
},

So if I call:

calendar.calendarList().insert(new CalendarListEntry())

I'd expect it to throw a NullPointerException with a nice message like 
"Required parameter id in CalendarListEntry must be specified".

Original issue reported on code.google.com by yan...@google.com on 24 Apr 2012 at 12:59

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 16 May 2012 at 1:24

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 30 May 2012 at 10:08

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 29 Aug 2012 at 11:20

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 8 Oct 2012 at 7:20

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 29 Oct 2012 at 7:29

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 13 Dec 2012 at 2:16

GoogleCodeExporter commented 9 years ago

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 rmis...@google.com on 7 Feb 2013 at 4:08

GoogleCodeExporter commented 9 years ago

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