mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-18 21:47:04 +00:00
@@ -191,8 +191,8 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfArrayOfNumberOnly is not found in the empty JSON string", ArrayOfArrayOfNumberOnly.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("ArrayArrayNumber").isJsonArray()) {
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("ArrayArrayNumber") != null && !jsonObj.get("ArrayArrayNumber").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `ArrayArrayNumber` to be an array in the JSON string but got `%s`", jsonObj.get("ArrayArrayNumber").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,8 +191,8 @@ public class ArrayOfNumberOnly {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfNumberOnly is not found in the empty JSON string", ArrayOfNumberOnly.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("ArrayNumber").isJsonArray()) {
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("ArrayNumber") != null && !jsonObj.get("ArrayNumber").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `ArrayNumber` to be an array in the JSON string but got `%s`", jsonObj.get("ArrayNumber").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,16 +267,16 @@ public class ArrayTest {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTest is not found in the empty JSON string", ArrayTest.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("array_of_string").isJsonArray()) {
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("array_of_string") != null && !jsonObj.get("array_of_string").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_of_string` to be an array in the JSON string but got `%s`", jsonObj.get("array_of_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("array_array_of_integer").isJsonArray()) {
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("array_array_of_integer") != null && !jsonObj.get("array_array_of_integer").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_array_of_integer` to be an array in the JSON string but got `%s`", jsonObj.get("array_array_of_integer").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("array_array_of_model").isJsonArray()) {
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("array_array_of_model") != null && !jsonObj.get("array_array_of_model").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_array_of_model` to be an array in the JSON string but got `%s`", jsonObj.get("array_array_of_model").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,8 +317,8 @@ public class EnumArrays {
|
||||
if ((jsonObj.get("just_symbol") != null && !jsonObj.get("just_symbol").isJsonNull()) && !jsonObj.get("just_symbol").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `just_symbol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("just_symbol").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("array_enum").isJsonArray()) {
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("array_enum") != null && !jsonObj.get("array_enum").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_enum` to be an array in the JSON string but got `%s`", jsonObj.get("array_enum").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,16 +551,16 @@ public class NullableClass {
|
||||
if ((jsonObj.get("string_prop") != null && !jsonObj.get("string_prop").isJsonNull()) && !jsonObj.get("string_prop").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `string_prop` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_prop").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("array_nullable_prop").isJsonArray()) {
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("array_nullable_prop") != null && !jsonObj.get("array_nullable_prop").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_nullable_prop` to be an array in the JSON string but got `%s`", jsonObj.get("array_nullable_prop").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("array_and_items_nullable_prop").isJsonArray()) {
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("array_and_items_nullable_prop") != null && !jsonObj.get("array_and_items_nullable_prop").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_and_items_nullable_prop` to be an array in the JSON string but got `%s`", jsonObj.get("array_and_items_nullable_prop").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("array_items_nullable").isJsonArray()) {
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("array_items_nullable") != null && !jsonObj.get("array_items_nullable").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_items_nullable` to be an array in the JSON string but got `%s`", jsonObj.get("array_items_nullable").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,8 +295,8 @@ public class ObjectWithDeprecatedFields {
|
||||
if (jsonObj.get("deprecatedRef") != null && !jsonObj.get("deprecatedRef").isJsonNull()) {
|
||||
DeprecatedObject.validateJsonObject(jsonObj.getAsJsonObject("deprecatedRef"));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("bars").isJsonArray()) {
|
||||
// ensure the optional json data is an array if present
|
||||
if (jsonObj.get("bars") != null && !jsonObj.get("bars").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `bars` to be an array in the JSON string but got `%s`", jsonObj.get("bars").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,8 +412,10 @@ public class Pet {
|
||||
if (!jsonObj.get("name").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if ((jsonObj.get("photoUrls") != null && !jsonObj.get("photoUrls").isJsonNull()) && !jsonObj.get("photoUrls").isJsonArray()) {
|
||||
// ensure the required json array is present
|
||||
if (jsonObj.get("photoUrls") == null) {
|
||||
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
|
||||
} else if (!jsonObj.get("photoUrls").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj.get("photoUrls").toString()));
|
||||
}
|
||||
if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) {
|
||||
|
||||
@@ -410,8 +410,10 @@ public class PetWithRequiredTags {
|
||||
if (!jsonObj.get("name").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if ((jsonObj.get("photoUrls") != null && !jsonObj.get("photoUrls").isJsonNull()) && !jsonObj.get("photoUrls").isJsonArray()) {
|
||||
// ensure the required json array is present
|
||||
if (jsonObj.get("photoUrls") == null) {
|
||||
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
|
||||
} else if (!jsonObj.get("photoUrls").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj.get("photoUrls").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
|
||||
Reference in New Issue
Block a user