DATAREST-41 Slight tweak to fix to ensure that a links property is never specified as anything other than an array on incoming JSON.

This commit is contained in:
Jon Brisbin
2012-09-04 10:34:14 -05:00
committed by Jon Brisbin
parent ae8d7d9326
commit a2288b7242

View File

@@ -260,8 +260,13 @@ public class RepositoryAwareJacksonModule extends SimpleModule implements Initia
}
if("links".equals(name)) {
while((tok = jp.nextToken()) != JsonToken.END_ARRAY) {
// Advance past the links
if((tok = jp.nextToken()) == JsonToken.START_ARRAY) {
while((tok = jp.nextToken()) != JsonToken.END_ARRAY) {
// Advance past the links
}
} else {
throw new HttpMessageNotReadableException(
"Property 'links' is not of array type. Either eliminate this property from the document or make it an array.");
}
continue;
}