forked from loafle/openapi-generator-original
more checks in validateJsonObject (#12041)
This commit is contained in:
@@ -457,22 +457,43 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#items.isModel}}
|
||||
JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}");
|
||||
{{#isRequired}}
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("{{{baseName}}}").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString()));
|
||||
}
|
||||
|
||||
// validate the required field `{{{baseName}}}` (array)
|
||||
for (int i = 0; i < jsonArray{{name}}.size(); i++) {
|
||||
{{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject());
|
||||
};
|
||||
{{/isRequired}}
|
||||
{{^isRequired}}
|
||||
// validate the optional field `{{{baseName}}}` (array)
|
||||
if (jsonArray{{name}} != null) {
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("{{{baseName}}}").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString()));
|
||||
}
|
||||
|
||||
// validate the optional field `{{{baseName}}}` (array)
|
||||
for (int i = 0; i < jsonArray{{name}}.size(); i++) {
|
||||
{{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject());
|
||||
};
|
||||
}
|
||||
{{/isRequired}}
|
||||
{{/items.isModel}}
|
||||
{{^items.isModel}}
|
||||
// ensure the json data is an array
|
||||
if ({{^isRequired}}jsonObj.get("{{{baseName}}}") != null && {{/isRequired}}!jsonObj.get("{{{baseName}}}").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString()));
|
||||
}
|
||||
{{/items.isModel}}
|
||||
{{/isArray}}
|
||||
{{^isContainer}}
|
||||
{{#isString}}
|
||||
if ({{^isRequired}}jsonObj.get("{{{baseName}}}") != null && {{/isRequired}}!jsonObj.get("{{{baseName}}}").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be a primitive type in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString()));
|
||||
}
|
||||
{{/isString}}
|
||||
{{#isModel}}
|
||||
{{#isRequired}}
|
||||
// validate the required field `{{{baseName}}}`
|
||||
|
||||
@@ -317,6 +317,15 @@ public class SomeObj {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SomeObj` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("$_type") != null && !jsonObj.get("$_type").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `$_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("$_type").toString()));
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -152,6 +152,9 @@ public class AdditionalPropertiesAnyType {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesAnyType` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -153,6 +153,9 @@ public class AdditionalPropertiesArray {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesArray` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -152,6 +152,9 @@ public class AdditionalPropertiesBoolean {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesBoolean` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -152,6 +152,9 @@ public class AdditionalPropertiesInteger {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesInteger` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -153,6 +153,9 @@ public class AdditionalPropertiesNumber {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesNumber` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -153,6 +153,9 @@ public class AdditionalPropertiesObject {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesObject` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -152,6 +152,9 @@ public class AdditionalPropertiesString {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesString` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -163,6 +163,10 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
// ensure the json data is an array
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -163,6 +163,10 @@ public class ArrayOfNumberOnly {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
// ensure the json data is an array
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -239,6 +239,18 @@ public class ArrayTest {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
// ensure the json data is an array
|
||||
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") != 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") != 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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -203,6 +203,9 @@ public class BigCatAllOf {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BigCatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -302,6 +302,24 @@ public class Capitalization {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Capitalization` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("smallCamel") != null && !jsonObj.get("smallCamel").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `smallCamel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smallCamel").toString()));
|
||||
}
|
||||
if (jsonObj.get("CapitalCamel") != null && !jsonObj.get("CapitalCamel").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `CapitalCamel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CapitalCamel").toString()));
|
||||
}
|
||||
if (jsonObj.get("small_Snake") != null && !jsonObj.get("small_Snake").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `small_Snake` to be a primitive type in the JSON string but got `%s`", jsonObj.get("small_Snake").toString()));
|
||||
}
|
||||
if (jsonObj.get("Capital_Snake") != null && !jsonObj.get("Capital_Snake").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `Capital_Snake` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Capital_Snake").toString()));
|
||||
}
|
||||
if (jsonObj.get("SCA_ETH_Flow_Points") != null && !jsonObj.get("SCA_ETH_Flow_Points").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `SCA_ETH_Flow_Points` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SCA_ETH_Flow_Points").toString()));
|
||||
}
|
||||
if (jsonObj.get("ATT_NAME") != null && !jsonObj.get("ATT_NAME").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `ATT_NAME` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ATT_NAME").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -190,6 +190,9 @@ public class Category {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -153,6 +153,9 @@ public class ClassModel {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClassModel` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("_class") != null && !jsonObj.get("_class").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `_class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_class").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -152,6 +152,9 @@ public class Client {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Client` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("client") != null && !jsonObj.get("client").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `client` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -152,6 +152,9 @@ public class DogAllOf {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DogAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("breed") != null && !jsonObj.get("breed").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `breed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("breed").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -286,6 +286,13 @@ public class EnumArrays {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumArrays` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("just_symbol") != null && !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") != 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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -473,6 +473,12 @@ public class EnumTest {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("enum_string") != null && !jsonObj.get("enum_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `enum_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enum_string").toString()));
|
||||
}
|
||||
if (jsonObj.get("enum_string_required") != null && !jsonObj.get("enum_string_required").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `enum_string_required` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enum_string_required").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -198,8 +198,13 @@ public class FileSchemaTestClass {
|
||||
ModelFile.validateJsonObject(jsonObj.getAsJsonObject("file"));
|
||||
}
|
||||
JsonArray jsonArrayfiles = jsonObj.getAsJsonArray("files");
|
||||
// validate the optional field `files` (array)
|
||||
if (jsonArrayfiles != null) {
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("files").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `files` to be an array in the JSON string but got `%s`", jsonObj.get("files").toString()));
|
||||
}
|
||||
|
||||
// validate the optional field `files` (array)
|
||||
for (int i = 0; i < jsonArrayfiles.size(); i++) {
|
||||
ModelFile.validateJsonObject(jsonArrayfiles.get(i).getAsJsonObject());
|
||||
};
|
||||
|
||||
@@ -568,6 +568,15 @@ public class FormatTest {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("string") != null && !jsonObj.get("string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string").toString()));
|
||||
}
|
||||
if (jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString()));
|
||||
}
|
||||
if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -174,6 +174,12 @@ public class HasOnlyReadOnly {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasOnlyReadOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("bar") != null && !jsonObj.get("bar").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `bar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bar").toString()));
|
||||
}
|
||||
if (jsonObj.get("foo") != null && !jsonObj.get("foo").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `foo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("foo").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -226,6 +226,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -183,6 +183,9 @@ public class Model200Response {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Model200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("class") != null && !jsonObj.get("class").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("class").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -212,6 +212,12 @@ public class ModelApiResponse {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelApiResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString()));
|
||||
}
|
||||
if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -153,6 +153,9 @@ public class ModelFile {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("sourceURI") != null && !jsonObj.get("sourceURI").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `sourceURI` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceURI").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -152,6 +152,9 @@ public class ModelList {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelList` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("123-list") != null && !jsonObj.get("123-list").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `123-list` to be a primitive type in the JSON string but got `%s`", jsonObj.get("123-list").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -243,6 +243,9 @@ public class Name {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("property") != null && !jsonObj.get("property").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `property` to be a primitive type in the JSON string but got `%s`", jsonObj.get("property").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -352,6 +352,9 @@ public class Order {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Order` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -213,6 +213,9 @@ public class OuterComposite {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OuterComposite` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("my_string") != null && !jsonObj.get("my_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `my_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("my_string").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -383,13 +383,28 @@ public class Pet {
|
||||
if (jsonObj.getAsJsonObject("category") != null) {
|
||||
Category.validateJsonObject(jsonObj.getAsJsonObject("category"));
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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").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()));
|
||||
}
|
||||
JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags");
|
||||
// validate the optional field `tags` (array)
|
||||
if (jsonArraytags != null) {
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("tags").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString()));
|
||||
}
|
||||
|
||||
// validate the optional field `tags` (array)
|
||||
for (int i = 0; i < jsonArraytags.size(); i++) {
|
||||
Tag.validateJsonObject(jsonArraytags.get(i).getAsJsonObject());
|
||||
};
|
||||
}
|
||||
if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -181,6 +181,12 @@ public class ReadOnlyFirst {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadOnlyFirst` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("bar") != null && !jsonObj.get("bar").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `bar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bar").toString()));
|
||||
}
|
||||
if (jsonObj.get("baz") != null && !jsonObj.get("baz").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `baz` to be a primitive type in the JSON string but got `%s`", jsonObj.get("baz").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -182,6 +182,9 @@ public class Tag {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Tag` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -292,6 +292,13 @@ public class TypeHolderDefault {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("string_item") != null && !jsonObj.get("string_item").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `string_item` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_item").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("array_item") != null && !jsonObj.get("array_item").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_item` to be an array in the JSON string but got `%s`", jsonObj.get("array_item").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -323,6 +323,13 @@ public class TypeHolderExample {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("string_item") != null && !jsonObj.get("string_item").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `string_item` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_item").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("array_item") != null && !jsonObj.get("array_item").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_item` to be an array in the JSON string but got `%s`", jsonObj.get("array_item").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -362,6 +362,24 @@ public class User {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString()));
|
||||
}
|
||||
if (jsonObj.get("firstName") != null && !jsonObj.get("firstName").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `firstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstName").toString()));
|
||||
}
|
||||
if (jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString()));
|
||||
}
|
||||
if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString()));
|
||||
}
|
||||
if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString()));
|
||||
}
|
||||
if (jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -1067,6 +1067,57 @@ public class XmlItem {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `XmlItem` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("attribute_string") != null && !jsonObj.get("attribute_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `attribute_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attribute_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("wrapped_array") != null && !jsonObj.get("wrapped_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("wrapped_array").toString()));
|
||||
}
|
||||
if (jsonObj.get("name_string") != null && !jsonObj.get("name_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `name_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("name_array") != null && !jsonObj.get("name_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `name_array` to be an array in the JSON string but got `%s`", jsonObj.get("name_array").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("name_wrapped_array") != null && !jsonObj.get("name_wrapped_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `name_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("name_wrapped_array").toString()));
|
||||
}
|
||||
if (jsonObj.get("prefix_string") != null && !jsonObj.get("prefix_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("prefix_array") != null && !jsonObj.get("prefix_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_array").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("prefix_wrapped_array") != null && !jsonObj.get("prefix_wrapped_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_wrapped_array").toString()));
|
||||
}
|
||||
if (jsonObj.get("namespace_string") != null && !jsonObj.get("namespace_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `namespace_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("namespace_array") != null && !jsonObj.get("namespace_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `namespace_array` to be an array in the JSON string but got `%s`", jsonObj.get("namespace_array").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("namespace_wrapped_array") != null && !jsonObj.get("namespace_wrapped_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `namespace_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("namespace_wrapped_array").toString()));
|
||||
}
|
||||
if (jsonObj.get("prefix_ns_string") != null && !jsonObj.get("prefix_ns_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix_ns_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("prefix_ns_array") != null && !jsonObj.get("prefix_ns_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_ns_array").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("prefix_ns_wrapped_array") != null && !jsonObj.get("prefix_ns_wrapped_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_ns_wrapped_array").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -175,6 +175,9 @@ public class AdditionalPropertiesAnyType implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesAnyType` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -176,6 +176,9 @@ public class AdditionalPropertiesArray implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesArray` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -175,6 +175,9 @@ public class AdditionalPropertiesBoolean implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesBoolean` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -175,6 +175,9 @@ public class AdditionalPropertiesInteger implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesInteger` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -176,6 +176,9 @@ public class AdditionalPropertiesNumber implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesNumber` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -176,6 +176,9 @@ public class AdditionalPropertiesObject implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesObject` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -175,6 +175,9 @@ public class AdditionalPropertiesString implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesString` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -186,6 +186,10 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
// ensure the json data is an array
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -186,6 +186,10 @@ public class ArrayOfNumberOnly implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
// ensure the json data is an array
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -266,6 +266,18 @@ public class ArrayTest implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
// ensure the json data is an array
|
||||
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") != 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") != 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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -226,6 +226,9 @@ public class BigCatAllOf implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BigCatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -335,6 +335,24 @@ public class Capitalization implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Capitalization` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("smallCamel") != null && !jsonObj.get("smallCamel").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `smallCamel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smallCamel").toString()));
|
||||
}
|
||||
if (jsonObj.get("CapitalCamel") != null && !jsonObj.get("CapitalCamel").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `CapitalCamel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CapitalCamel").toString()));
|
||||
}
|
||||
if (jsonObj.get("small_Snake") != null && !jsonObj.get("small_Snake").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `small_Snake` to be a primitive type in the JSON string but got `%s`", jsonObj.get("small_Snake").toString()));
|
||||
}
|
||||
if (jsonObj.get("Capital_Snake") != null && !jsonObj.get("Capital_Snake").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `Capital_Snake` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Capital_Snake").toString()));
|
||||
}
|
||||
if (jsonObj.get("SCA_ETH_Flow_Points") != null && !jsonObj.get("SCA_ETH_Flow_Points").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `SCA_ETH_Flow_Points` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SCA_ETH_Flow_Points").toString()));
|
||||
}
|
||||
if (jsonObj.get("ATT_NAME") != null && !jsonObj.get("ATT_NAME").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `ATT_NAME` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ATT_NAME").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -215,6 +215,9 @@ public class Category implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -176,6 +176,9 @@ public class ClassModel implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClassModel` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("_class") != null && !jsonObj.get("_class").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `_class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_class").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -175,6 +175,9 @@ public class Client implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Client` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("client") != null && !jsonObj.get("client").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `client` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -175,6 +175,9 @@ public class DogAllOf implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DogAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("breed") != null && !jsonObj.get("breed").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `breed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("breed").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -311,6 +311,13 @@ public class EnumArrays implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumArrays` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("just_symbol") != null && !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") != 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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -504,6 +504,12 @@ public class EnumTest implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("enum_string") != null && !jsonObj.get("enum_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `enum_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enum_string").toString()));
|
||||
}
|
||||
if (jsonObj.get("enum_string_required") != null && !jsonObj.get("enum_string_required").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `enum_string_required` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enum_string_required").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -223,8 +223,13 @@ public class FileSchemaTestClass implements Parcelable {
|
||||
ModelFile.validateJsonObject(jsonObj.getAsJsonObject("file"));
|
||||
}
|
||||
JsonArray jsonArrayfiles = jsonObj.getAsJsonArray("files");
|
||||
// validate the optional field `files` (array)
|
||||
if (jsonArrayfiles != null) {
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("files").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `files` to be an array in the JSON string but got `%s`", jsonObj.get("files").toString()));
|
||||
}
|
||||
|
||||
// validate the optional field `files` (array)
|
||||
for (int i = 0; i < jsonArrayfiles.size(); i++) {
|
||||
ModelFile.validateJsonObject(jsonArrayfiles.get(i).getAsJsonObject());
|
||||
};
|
||||
|
||||
@@ -617,6 +617,15 @@ public class FormatTest implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("string") != null && !jsonObj.get("string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string").toString()));
|
||||
}
|
||||
if (jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString()));
|
||||
}
|
||||
if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -199,6 +199,12 @@ public class HasOnlyReadOnly implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasOnlyReadOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("bar") != null && !jsonObj.get("bar").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `bar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bar").toString()));
|
||||
}
|
||||
if (jsonObj.get("foo") != null && !jsonObj.get("foo").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `foo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("foo").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -253,6 +253,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -208,6 +208,9 @@ public class Model200Response implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Model200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("class") != null && !jsonObj.get("class").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("class").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -239,6 +239,12 @@ public class ModelApiResponse implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelApiResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString()));
|
||||
}
|
||||
if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -176,6 +176,9 @@ public class ModelFile implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("sourceURI") != null && !jsonObj.get("sourceURI").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `sourceURI` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceURI").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -175,6 +175,9 @@ public class ModelList implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelList` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("123-list") != null && !jsonObj.get("123-list").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `123-list` to be a primitive type in the JSON string but got `%s`", jsonObj.get("123-list").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -272,6 +272,9 @@ public class Name implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("property") != null && !jsonObj.get("property").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `property` to be a primitive type in the JSON string but got `%s`", jsonObj.get("property").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -385,6 +385,9 @@ public class Order implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Order` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -240,6 +240,9 @@ public class OuterComposite implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OuterComposite` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("my_string") != null && !jsonObj.get("my_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `my_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("my_string").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -416,13 +416,28 @@ public class Pet implements Parcelable {
|
||||
if (jsonObj.getAsJsonObject("category") != null) {
|
||||
Category.validateJsonObject(jsonObj.getAsJsonObject("category"));
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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").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()));
|
||||
}
|
||||
JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags");
|
||||
// validate the optional field `tags` (array)
|
||||
if (jsonArraytags != null) {
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("tags").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString()));
|
||||
}
|
||||
|
||||
// validate the optional field `tags` (array)
|
||||
for (int i = 0; i < jsonArraytags.size(); i++) {
|
||||
Tag.validateJsonObject(jsonArraytags.get(i).getAsJsonObject());
|
||||
};
|
||||
}
|
||||
if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -206,6 +206,12 @@ public class ReadOnlyFirst implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadOnlyFirst` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("bar") != null && !jsonObj.get("bar").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `bar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bar").toString()));
|
||||
}
|
||||
if (jsonObj.get("baz") != null && !jsonObj.get("baz").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `baz` to be a primitive type in the JSON string but got `%s`", jsonObj.get("baz").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -207,6 +207,9 @@ public class Tag implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Tag` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -323,6 +323,13 @@ public class TypeHolderDefault implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("string_item") != null && !jsonObj.get("string_item").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `string_item` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_item").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("array_item") != null && !jsonObj.get("array_item").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_item` to be an array in the JSON string but got `%s`", jsonObj.get("array_item").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -356,6 +356,13 @@ public class TypeHolderExample implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("string_item") != null && !jsonObj.get("string_item").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `string_item` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_item").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("array_item") != null && !jsonObj.get("array_item").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `array_item` to be an array in the JSON string but got `%s`", jsonObj.get("array_item").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -399,6 +399,24 @@ public class User implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString()));
|
||||
}
|
||||
if (jsonObj.get("firstName") != null && !jsonObj.get("firstName").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `firstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstName").toString()));
|
||||
}
|
||||
if (jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString()));
|
||||
}
|
||||
if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString()));
|
||||
}
|
||||
if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString()));
|
||||
}
|
||||
if (jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -1146,6 +1146,57 @@ public class XmlItem implements Parcelable {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `XmlItem` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("attribute_string") != null && !jsonObj.get("attribute_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `attribute_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attribute_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("wrapped_array") != null && !jsonObj.get("wrapped_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("wrapped_array").toString()));
|
||||
}
|
||||
if (jsonObj.get("name_string") != null && !jsonObj.get("name_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `name_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("name_array") != null && !jsonObj.get("name_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `name_array` to be an array in the JSON string but got `%s`", jsonObj.get("name_array").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("name_wrapped_array") != null && !jsonObj.get("name_wrapped_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `name_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("name_wrapped_array").toString()));
|
||||
}
|
||||
if (jsonObj.get("prefix_string") != null && !jsonObj.get("prefix_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("prefix_array") != null && !jsonObj.get("prefix_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_array").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("prefix_wrapped_array") != null && !jsonObj.get("prefix_wrapped_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_wrapped_array").toString()));
|
||||
}
|
||||
if (jsonObj.get("namespace_string") != null && !jsonObj.get("namespace_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `namespace_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("namespace_array") != null && !jsonObj.get("namespace_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `namespace_array` to be an array in the JSON string but got `%s`", jsonObj.get("namespace_array").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("namespace_wrapped_array") != null && !jsonObj.get("namespace_wrapped_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `namespace_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("namespace_wrapped_array").toString()));
|
||||
}
|
||||
if (jsonObj.get("prefix_ns_string") != null && !jsonObj.get("prefix_ns_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix_ns_string").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("prefix_ns_array") != null && !jsonObj.get("prefix_ns_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_ns_array").toString()));
|
||||
}
|
||||
// ensure the json data is an array
|
||||
if (jsonObj.get("prefix_ns_wrapped_array") != null && !jsonObj.get("prefix_ns_wrapped_array").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_ns_wrapped_array").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -211,6 +211,12 @@ public class Apple {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Apple is not found in the empty JSON string", Apple.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("cultivar") != null && !jsonObj.get("cultivar").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `cultivar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cultivar").toString()));
|
||||
}
|
||||
if (jsonObj.get("origin") != null && !jsonObj.get("origin").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -190,6 +190,9 @@ public class AppleReq {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("cultivar") != null && !jsonObj.get("cultivar").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `cultivar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cultivar").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -192,6 +192,10 @@ 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") != 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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -192,6 +192,10 @@ 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") != 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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -268,6 +268,18 @@ 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") != 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") != 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") != 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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -189,6 +189,9 @@ public class BasquePig {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("className") != null && !jsonObj.get("className").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `className` to be a primitive type in the JSON string but got `%s`", jsonObj.get("className").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -331,6 +331,24 @@ public class Capitalization {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Capitalization is not found in the empty JSON string", Capitalization.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("smallCamel") != null && !jsonObj.get("smallCamel").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `smallCamel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smallCamel").toString()));
|
||||
}
|
||||
if (jsonObj.get("CapitalCamel") != null && !jsonObj.get("CapitalCamel").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `CapitalCamel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CapitalCamel").toString()));
|
||||
}
|
||||
if (jsonObj.get("small_Snake") != null && !jsonObj.get("small_Snake").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `small_Snake` to be a primitive type in the JSON string but got `%s`", jsonObj.get("small_Snake").toString()));
|
||||
}
|
||||
if (jsonObj.get("Capital_Snake") != null && !jsonObj.get("Capital_Snake").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `Capital_Snake` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Capital_Snake").toString()));
|
||||
}
|
||||
if (jsonObj.get("SCA_ETH_Flow_Points") != null && !jsonObj.get("SCA_ETH_Flow_Points").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `SCA_ETH_Flow_Points` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SCA_ETH_Flow_Points").toString()));
|
||||
}
|
||||
if (jsonObj.get("ATT_NAME") != null && !jsonObj.get("ATT_NAME").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `ATT_NAME` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ATT_NAME").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -219,6 +219,9 @@ public class Category {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -182,6 +182,9 @@ public class ClassModel {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in ClassModel is not found in the empty JSON string", ClassModel.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("_class") != null && !jsonObj.get("_class").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `_class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("_class").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -181,6 +181,9 @@ public class Client {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Client is not found in the empty JSON string", Client.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("client") != null && !jsonObj.get("client").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `client` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -222,6 +222,12 @@ public class ComplexQuadrilateral {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("shapeType") != null && !jsonObj.get("shapeType").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `shapeType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shapeType").toString()));
|
||||
}
|
||||
if (jsonObj.get("quadrilateralType") != null && !jsonObj.get("quadrilateralType").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `quadrilateralType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("quadrilateralType").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -189,6 +189,9 @@ public class DanishPig {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("className") != null && !jsonObj.get("className").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `className` to be a primitive type in the JSON string but got `%s`", jsonObj.get("className").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -183,6 +183,9 @@ public class DeprecatedObject {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in DeprecatedObject is not found in the empty JSON string", DeprecatedObject.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("name") != null && !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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -181,6 +181,9 @@ public class DogAllOf {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in DogAllOf is not found in the empty JSON string", DogAllOf.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("breed") != null && !jsonObj.get("breed").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `breed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("breed").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -281,8 +281,13 @@ public class Drawing {
|
||||
NullableShape.validateJsonObject(jsonObj.getAsJsonObject("nullableShape"));
|
||||
}
|
||||
JsonArray jsonArrayshapes = jsonObj.getAsJsonArray("shapes");
|
||||
// validate the optional field `shapes` (array)
|
||||
if (jsonArrayshapes != null) {
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("shapes").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `shapes` to be an array in the JSON string but got `%s`", jsonObj.get("shapes").toString()));
|
||||
}
|
||||
|
||||
// validate the optional field `shapes` (array)
|
||||
for (int i = 0; i < jsonArrayshapes.size(); i++) {
|
||||
Shape.validateJsonObject(jsonArrayshapes.get(i).getAsJsonObject());
|
||||
};
|
||||
|
||||
@@ -315,6 +315,13 @@ public class EnumArrays {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in EnumArrays is not found in the empty JSON string", EnumArrays.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("just_symbol") != null && !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") != 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()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -684,6 +684,12 @@ public class EnumTest {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("enum_string") != null && !jsonObj.get("enum_string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `enum_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enum_string").toString()));
|
||||
}
|
||||
if (jsonObj.get("enum_string_required") != null && !jsonObj.get("enum_string_required").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `enum_string_required` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enum_string_required").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -222,6 +222,12 @@ public class EquilateralTriangle {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("shapeType") != null && !jsonObj.get("shapeType").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `shapeType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shapeType").toString()));
|
||||
}
|
||||
if (jsonObj.get("triangleType") != null && !jsonObj.get("triangleType").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `triangleType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("triangleType").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -227,8 +227,13 @@ public class FileSchemaTestClass {
|
||||
ModelFile.validateJsonObject(jsonObj.getAsJsonObject("file"));
|
||||
}
|
||||
JsonArray jsonArrayfiles = jsonObj.getAsJsonArray("files");
|
||||
// validate the optional field `files` (array)
|
||||
if (jsonArrayfiles != null) {
|
||||
// ensure the json data is an array
|
||||
if (!jsonObj.get("files").isJsonArray()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `files` to be an array in the JSON string but got `%s`", jsonObj.get("files").toString()));
|
||||
}
|
||||
|
||||
// validate the optional field `files` (array)
|
||||
for (int i = 0; i < jsonArrayfiles.size(); i++) {
|
||||
ModelFile.validateJsonObject(jsonArrayfiles.get(i).getAsJsonObject());
|
||||
};
|
||||
|
||||
@@ -181,6 +181,9 @@ public class Foo {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Foo is not found in the empty JSON string", Foo.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("bar") != null && !jsonObj.get("bar").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `bar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bar").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -657,6 +657,21 @@ public class FormatTest {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("string") != null && !jsonObj.get("string").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string").toString()));
|
||||
}
|
||||
if (jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString()));
|
||||
}
|
||||
if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString()));
|
||||
}
|
||||
if (jsonObj.get("pattern_with_digits") != null && !jsonObj.get("pattern_with_digits").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `pattern_with_digits` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pattern_with_digits").toString()));
|
||||
}
|
||||
if (jsonObj.get("pattern_with_digits_and_delimiter") != null && !jsonObj.get("pattern_with_digits_and_delimiter").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `pattern_with_digits_and_delimiter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pattern_with_digits_and_delimiter").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -203,6 +203,12 @@ public class HasOnlyReadOnly {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in HasOnlyReadOnly is not found in the empty JSON string", HasOnlyReadOnly.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("bar") != null && !jsonObj.get("bar").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `bar` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bar").toString()));
|
||||
}
|
||||
if (jsonObj.get("foo") != null && !jsonObj.get("foo").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `foo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("foo").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -194,6 +194,9 @@ public class HealthCheckResult {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in HealthCheckResult is not found in the empty JSON string", HealthCheckResult.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("NullableMessage") != null && !jsonObj.get("NullableMessage").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `NullableMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NullableMessage").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -193,6 +193,12 @@ public class IsoscelesTriangle {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("shapeType") != null && !jsonObj.get("shapeType").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `shapeType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shapeType").toString()));
|
||||
}
|
||||
if (jsonObj.get("triangleType") != null && !jsonObj.get("triangleType").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `triangleType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("triangleType").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -255,6 +255,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in MixedPropertiesAndAdditionalPropertiesClass is not found in the empty JSON string", MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("uuid") != null && !jsonObj.get("uuid").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uuid").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
@@ -212,6 +212,9 @@ public class Model200Response {
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Model200Response is not found in the empty JSON string", Model200Response.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
if (jsonObj.get("class") != null && !jsonObj.get("class").isJsonPrimitive()) {
|
||||
throw new IllegalArgumentException(String.format("Expected the field `class` to be a primitive type in the JSON string but got `%s`", jsonObj.get("class").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user