@@ -34,12 +34,12 @@ public class FaceDetectionItem {
3434 public static final String SERIALIZED_NAME_FACE_DETECTION = "FaceDetection" ;
3535
3636 @ SerializedName (SERIALIZED_NAME_FACE_DETECTION )
37- @ javax .annotation .Nonnull
37+ @ javax .annotation .Nullable
3838 private FaceDetection faceDetection ;
3939
4040 public FaceDetectionItem () {}
4141
42- public FaceDetectionItem faceDetection (@ javax .annotation .Nonnull FaceDetection faceDetection ) {
42+ public FaceDetectionItem faceDetection (@ javax .annotation .Nullable FaceDetection faceDetection ) {
4343 this .faceDetection = faceDetection ;
4444 return this ;
4545 }
@@ -49,12 +49,12 @@ public FaceDetectionItem faceDetection(@javax.annotation.Nonnull FaceDetection f
4949 *
5050 * @return faceDetection
5151 */
52- @ javax .annotation .Nonnull
52+ @ javax .annotation .Nullable
5353 public FaceDetection getFaceDetection () {
5454 return faceDetection ;
5555 }
5656
57- public void setFaceDetection (@ javax .annotation .Nonnull FaceDetection faceDetection ) {
57+ public void setFaceDetection (@ javax .annotation .Nullable FaceDetection faceDetection ) {
5858 this .faceDetection = faceDetection ;
5959 }
6060
@@ -104,7 +104,6 @@ private String toIndentedString(Object o) {
104104
105105 // a set of required properties/fields (JSON key names)
106106 openapiRequiredFields = new HashSet <String >();
107- openapiRequiredFields .add ("FaceDetection" );
108107 }
109108
110109 /**
@@ -124,18 +123,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
124123 }
125124 }
126125
127- // check to make sure all required properties/fields are present in the JSON string
128- for (String requiredField : FaceDetectionItem .openapiRequiredFields ) {
129- if (jsonElement .getAsJsonObject ().get (requiredField ) == null ) {
130- throw new IllegalArgumentException (
131- String .format (
132- "The required field `%s` is not found in the JSON string: %s" ,
133- requiredField , jsonElement .toString ()));
134- }
135- }
136126 JsonObject jsonObj = jsonElement .getAsJsonObject ();
137- // validate the required field `FaceDetection`
138- FaceDetection .validateJsonElement (jsonObj .get ("FaceDetection" ));
127+ // validate the optional field `FaceDetection`
128+ if (jsonObj .get ("FaceDetection" ) != null && !jsonObj .get ("FaceDetection" ).isJsonNull ()) {
129+ FaceDetection .validateJsonElement (jsonObj .get ("FaceDetection" ));
130+ }
139131 }
140132
141133 public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
0 commit comments