From fa5f875a43b54d53beb7c1b01ddfb9f6011cc434 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 18 Dec 2023 15:15:48 -0800 Subject: [PATCH 01/52] Checker framework added --- samples/client/3_0_3_unit_test/java/pom.xml | 28 ++++-- ...rtiesAllowsASchemaWhichShouldValidate.java | 4 +- ...ditionalpropertiesAreAllowedByDefault.java | 4 +- .../AdditionalpropertiesCanExistByItself.java | 4 +- ...lpropertiesShouldNotLookInApplicators.java | 6 +- .../client/components/schemas/Allof.java | 8 +- .../schemas/AllofCombinedWithAnyofOneof.java | 10 +- .../components/schemas/AllofSimpleTypes.java | 8 +- .../schemas/AllofWithBaseSchema.java | 8 +- .../schemas/AllofWithOneEmptySchema.java | 4 +- .../schemas/AllofWithTheFirstEmptySchema.java | 4 +- .../schemas/AllofWithTheLastEmptySchema.java | 4 +- .../schemas/AllofWithTwoEmptySchemas.java | 4 +- .../client/components/schemas/Anyof.java | 6 +- .../components/schemas/AnyofComplexTypes.java | 8 +- .../schemas/AnyofWithBaseSchema.java | 8 +- .../schemas/AnyofWithOneEmptySchema.java | 4 +- .../schemas/ArrayTypeMatchesArrays.java | 4 +- .../client/components/schemas/ByInt.java | 4 +- .../client/components/schemas/ByNumber.java | 4 +- .../components/schemas/BySmallNumber.java | 4 +- .../components/schemas/DateTimeFormat.java | 4 +- .../components/schemas/EmailFormat.java | 4 +- .../schemas/EnumWith0DoesNotMatchFalse.java | 4 +- .../schemas/EnumWith1DoesNotMatchTrue.java | 4 +- .../schemas/EnumWithEscapedCharacters.java | 4 +- .../schemas/EnumWithFalseDoesNotMatch0.java | 4 +- .../schemas/EnumWithTrueDoesNotMatch1.java | 4 +- .../components/schemas/EnumsInProperties.java | 8 +- .../components/schemas/ForbiddenProperty.java | 4 +- .../components/schemas/HostnameFormat.java | 4 +- ...ouldNotRaiseErrorWhenFloatDivisionInf.java | 4 +- .../schemas/InvalidStringValueForDefault.java | 6 +- .../client/components/schemas/Ipv4Format.java | 4 +- .../client/components/schemas/Ipv6Format.java | 4 +- .../components/schemas/JsonPointerFormat.java | 4 +- .../components/schemas/MaximumValidation.java | 4 +- .../MaximumValidationWithUnsignedInteger.java | 4 +- .../schemas/MaxitemsValidation.java | 4 +- .../schemas/MaxlengthValidation.java | 4 +- .../Maxproperties0MeansTheObjectIsEmpty.java | 4 +- .../schemas/MaxpropertiesValidation.java | 4 +- .../components/schemas/MinimumValidation.java | 4 +- .../MinimumValidationWithSignedInteger.java | 4 +- .../schemas/MinitemsValidation.java | 4 +- .../schemas/MinlengthValidation.java | 4 +- .../schemas/MinpropertiesValidation.java | 4 +- ...NestedAllofToCheckValidationSemantics.java | 6 +- ...NestedAnyofToCheckValidationSemantics.java | 6 +- .../components/schemas/NestedItems.java | 10 +- ...NestedOneofToCheckValidationSemantics.java | 6 +- .../client/components/schemas/Not.java | 4 +- .../schemas/NotMoreComplexSchema.java | 6 +- .../schemas/NulCharactersInStrings.java | 4 +- .../schemas/ObjectPropertiesValidation.java | 4 +- .../client/components/schemas/Oneof.java | 6 +- .../components/schemas/OneofComplexTypes.java | 8 +- .../schemas/OneofWithBaseSchema.java | 8 +- .../schemas/OneofWithEmptySchema.java | 4 +- .../components/schemas/OneofWithRequired.java | 8 +- .../schemas/PatternIsNotAnchored.java | 4 +- .../components/schemas/PatternValidation.java | 4 +- .../PropertiesWithEscapedCharacters.java | 4 +- .../PropertyNamedRefThatIsNotAReference.java | 4 +- .../schemas/RefInAdditionalproperties.java | 4 +- .../client/components/schemas/RefInAllof.java | 4 +- .../client/components/schemas/RefInAnyof.java | 4 +- .../client/components/schemas/RefInItems.java | 4 +- .../client/components/schemas/RefInNot.java | 4 +- .../client/components/schemas/RefInOneof.java | 4 +- .../components/schemas/RefInProperty.java | 4 +- .../schemas/RequiredDefaultValidation.java | 4 +- .../schemas/RequiredValidation.java | 4 +- .../schemas/RequiredWithEmptyArray.java | 4 +- .../RequiredWithEscapedCharacters.java | 4 +- .../schemas/SimpleEnumValidation.java | 4 +- ...esNotDoAnythingIfThePropertyIsMissing.java | 6 +- .../schemas/UniqueitemsFalseValidation.java | 4 +- .../schemas/UniqueitemsValidation.java | 4 +- .../client/components/schemas/UriFormat.java | 4 +- .../schemas/UriReferenceFormat.java | 4 +- .../components/schemas/UriTemplateFormat.java | 4 +- .../client/schemas/AnyTypeJsonSchema.java | 4 +- .../client/schemas/BooleanJsonSchema.java | 4 +- .../client/schemas/DateJsonSchema.java | 13 ++- .../client/schemas/DateTimeJsonSchema.java | 4 +- .../client/schemas/DecimalJsonSchema.java | 4 +- .../client/schemas/DoubleJsonSchema.java | 4 +- .../client/schemas/FloatJsonSchema.java | 4 +- .../client/schemas/Int32JsonSchema.java | 4 +- .../client/schemas/Int64JsonSchema.java | 4 +- .../client/schemas/IntJsonSchema.java | 4 +- .../client/schemas/ListJsonSchema.java | 4 +- .../client/schemas/MapJsonSchema.java | 4 +- .../client/schemas/NotAnyTypeJsonSchema.java | 4 +- .../client/schemas/NullJsonSchema.java | 4 +- .../client/schemas/NumberJsonSchema.java | 4 +- .../client/schemas/StringJsonSchema.java | 4 +- .../client/schemas/UuidJsonSchema.java | 4 +- .../client/schemas/validation/JsonSchema.java | 52 +++++----- .../schemas/validation/JsonSchemaInfo.java | 98 ++++++++++--------- .../validation/UnsetAnyTypeJsonSchema.java | 4 +- .../generators/JavaClientGenerator.java | 2 + src/main/resources/java/pom.hbs | 28 ++++-- .../_Schema_anytypeOrMultitype.hbs | 2 +- .../schemas/SchemaClass/_Schema_boolean.hbs | 2 +- .../schemas/SchemaClass/_Schema_list.hbs | 2 +- .../schemas/SchemaClass/_Schema_map.hbs | 2 +- .../schemas/SchemaClass/_Schema_null.hbs | 2 +- .../schemas/SchemaClass/_Schema_number.hbs | 2 +- .../schemas/SchemaClass/_Schema_string.hbs | 2 +- .../packagename/schemas/AnyTypeJsonSchema.hbs | 4 +- .../packagename/schemas/BooleanJsonSchema.hbs | 4 +- .../packagename/schemas/DateJsonSchema.hbs | 13 ++- .../schemas/DateTimeJsonSchema.hbs | 4 +- .../packagename/schemas/DecimalJsonSchema.hbs | 4 +- .../packagename/schemas/DoubleJsonSchema.hbs | 4 +- .../packagename/schemas/FloatJsonSchema.hbs | 4 +- .../packagename/schemas/Int32JsonSchema.hbs | 4 +- .../packagename/schemas/Int64JsonSchema.hbs | 4 +- .../packagename/schemas/IntJsonSchema.hbs | 4 +- .../packagename/schemas/ListJsonSchema.hbs | 4 +- .../packagename/schemas/MapJsonSchema.hbs | 4 +- .../schemas/NotAnyTypeJsonSchema.hbs | 4 +- .../packagename/schemas/NullJsonSchema.hbs | 4 +- .../packagename/schemas/NumberJsonSchema.hbs | 4 +- .../packagename/schemas/StringJsonSchema.hbs | 4 +- .../packagename/schemas/UuidJsonSchema.hbs | 4 +- .../schemas/validation/JsonSchema.hbs | 52 +++++----- .../schemas/validation/JsonSchemaInfo.hbs | 98 ++++++++++--------- .../validation/UnsetAnyTypeJsonSchema.hbs | 4 +- 131 files changed, 597 insertions(+), 327 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/pom.xml b/samples/client/3_0_3_unit_test/java/pom.xml index 4b3a6048553..c5d5385147d 100644 --- a/samples/client/3_0_3_unit_test/java/pom.xml +++ b/samples/client/3_0_3_unit_test/java/pom.xml @@ -47,9 +47,20 @@ -Xlint:all -J-Xss4m + + + org.checkerframework + checker + ${checker-version} + + + + + org.checkerframework.checker.nullness.NullnessChecker + + - org.apache.maven.plugins maven-enforcer-plugin @@ -213,13 +224,17 @@ ${swagger-annotations-version} - + - com.google.code.findbugs - jsr305 - 3.0.2 + org.checkerframework + checker-qual + ${checker-version} + + + org.checkerframework + checker + ${checker-version} - @@ -277,6 +292,7 @@ 17 UTF-8 1.6.3 + 3.42.0 1.19.4 2.12.6 2.12.6.1 diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 4e255e6be6d..02dea6dfb92 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -76,7 +78,7 @@ public static class AdditionalpropertiesAllowsASchemaWhichShouldValidate1 extend Do not edit the class manually. */ - private static AdditionalpropertiesAllowsASchemaWhichShouldValidate1 instance; + private static @Nullable AdditionalpropertiesAllowsASchemaWhichShouldValidate1 instance = null; protected AdditionalpropertiesAllowsASchemaWhichShouldValidate1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index 2b707c31875..c53237caaf2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -82,7 +84,7 @@ public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema Do not edit the class manually. */ - private static AdditionalpropertiesAreAllowedByDefault1 instance; + private static @Nullable AdditionalpropertiesAreAllowedByDefault1 instance = null; protected AdditionalpropertiesAreAllowedByDefault1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index a9f4d359ae7..f271300a667 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -53,7 +55,7 @@ public static class AdditionalpropertiesCanExistByItself1 extends JsonSchema imp Do not edit the class manually. */ - private static AdditionalpropertiesCanExistByItself1 instance; + private static @Nullable AdditionalpropertiesCanExistByItself1 instance = null; protected AdditionalpropertiesCanExistByItself1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index 6f25b0b4d47..602b37afd18 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -70,7 +72,7 @@ public static class Schema0MapInput { public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -270,7 +272,7 @@ public static class AdditionalpropertiesShouldNotLookInApplicators1 extends Json Do not edit the class manually. */ - private static AdditionalpropertiesShouldNotLookInApplicators1 instance; + private static @Nullable AdditionalpropertiesShouldNotLookInApplicators1 instance = null; protected AdditionalpropertiesShouldNotLookInApplicators1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index cc8695a185e..b965cf3cb48 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -65,7 +67,7 @@ public static class Schema0MapInput { public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -272,7 +274,7 @@ public static class Schema1MapInput { public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema1 instance; + private static @Nullable Schema1 instance = null; protected Schema1() { super(new JsonSchemaInfo() @@ -455,7 +457,7 @@ public static class Allof1 extends JsonSchema implements NullSchemaValidator, Bo Do not edit the class manually. */ - private static Allof1 instance; + private static @Nullable Allof1 instance = null; protected Allof1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index 4291a6bfff3..bb72d210e85 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -11,6 +11,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -33,7 +35,7 @@ public class AllofCombinedWithAnyofOneof { public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema02 instance; + private static @Nullable Schema02 instance = null; protected Schema02() { super(new JsonSchemaInfo() @@ -205,7 +207,7 @@ public Object getNewInstance(Object arg, List pathToItem, PathToSchemasM } public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema01 instance; + private static @Nullable Schema01 instance = null; protected Schema01() { super(new JsonSchemaInfo() @@ -377,7 +379,7 @@ public Object getNewInstance(Object arg, List pathToItem, PathToSchemasM } public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -555,7 +557,7 @@ public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements N Do not edit the class manually. */ - private static AllofCombinedWithAnyofOneof1 instance; + private static @Nullable AllofCombinedWithAnyofOneof1 instance = null; protected AllofCombinedWithAnyofOneof1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index c56c9dbe3eb..78a90f4526c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -32,7 +34,7 @@ public class AllofSimpleTypes { public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -204,7 +206,7 @@ public Object getNewInstance(Object arg, List pathToItem, PathToSchemasM } public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema1 instance; + private static @Nullable Schema1 instance = null; protected Schema1() { super(new JsonSchemaInfo() @@ -382,7 +384,7 @@ public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaVa Do not edit the class manually. */ - private static AllofSimpleTypes1 instance; + private static @Nullable AllofSimpleTypes1 instance = null; protected AllofSimpleTypes1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index f161abb0582..07947ea4675 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -66,7 +68,7 @@ public static class Schema0MapInput { public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -273,7 +275,7 @@ public static class Schema1MapInput { public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema1 instance; + private static @Nullable Schema1 instance = null; protected Schema1() { super(new JsonSchemaInfo() @@ -486,7 +488,7 @@ public static class AllofWithBaseSchema1 extends JsonSchema implements NullSchem Do not edit the class manually. */ - private static AllofWithBaseSchema1 instance; + private static @Nullable AllofWithBaseSchema1 instance = null; protected AllofWithBaseSchema1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index f61a417dbcc..733513de5dd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -42,7 +44,7 @@ public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullS Do not edit the class manually. */ - private static AllofWithOneEmptySchema1 instance; + private static @Nullable AllofWithOneEmptySchema1 instance = null; protected AllofWithOneEmptySchema1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index f24ef12c83e..8ca1a0d6999 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -46,7 +48,7 @@ public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements Do not edit the class manually. */ - private static AllofWithTheFirstEmptySchema1 instance; + private static @Nullable AllofWithTheFirstEmptySchema1 instance = null; protected AllofWithTheFirstEmptySchema1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index abd770f8a65..cf57dec0d9f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -46,7 +48,7 @@ public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements N Do not edit the class manually. */ - private static AllofWithTheLastEmptySchema1 instance; + private static @Nullable AllofWithTheLastEmptySchema1 instance = null; protected AllofWithTheLastEmptySchema1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index d8cbcbd2dd3..7e89f52acf7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -45,7 +47,7 @@ public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements Null Do not edit the class manually. */ - private static AllofWithTwoEmptySchemas1 instance; + private static @Nullable AllofWithTwoEmptySchemas1 instance = null; protected AllofWithTwoEmptySchemas1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index 3b29887c888..e8a7d1de08a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -36,7 +38,7 @@ public static class Schema0 extends IntJsonSchema {} public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema1 instance; + private static @Nullable Schema1 instance = null; protected Schema1() { super(new JsonSchemaInfo() @@ -214,7 +216,7 @@ public static class Anyof1 extends JsonSchema implements NullSchemaValidator, Bo Do not edit the class manually. */ - private static Anyof1 instance; + private static @Nullable Anyof1 instance = null; protected Anyof1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 576237e5a4f..34154803d37 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -65,7 +67,7 @@ public static class Schema0MapInput { public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -272,7 +274,7 @@ public static class Schema1MapInput { public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema1 instance; + private static @Nullable Schema1 instance = null; protected Schema1() { super(new JsonSchemaInfo() @@ -455,7 +457,7 @@ public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaV Do not edit the class manually. */ - private static AnyofComplexTypes1 instance; + private static @Nullable AnyofComplexTypes1 instance = null; protected AnyofComplexTypes1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index e69d8fc5378..b385d4b00f2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -32,7 +34,7 @@ public class AnyofWithBaseSchema { public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -204,7 +206,7 @@ public Object getNewInstance(Object arg, List pathToItem, PathToSchemasM } public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema1 instance; + private static @Nullable Schema1 instance = null; protected Schema1() { super(new JsonSchemaInfo() @@ -382,7 +384,7 @@ public static class AnyofWithBaseSchema1 extends JsonSchema implements StringSch Do not edit the class manually. */ - private static AnyofWithBaseSchema1 instance; + private static @Nullable AnyofWithBaseSchema1 instance = null; protected AnyofWithBaseSchema1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index 24805befbaa..344e63e76bd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -46,7 +48,7 @@ public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullS Do not edit the class manually. */ - private static AnyofWithOneEmptySchema1 instance; + private static @Nullable AnyofWithOneEmptySchema1 instance = null; protected AnyofWithOneEmptySchema1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java index 2c679401d9a..4278313b529 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -47,7 +49,7 @@ public static class ArrayTypeMatchesArrays1 extends JsonSchema implements ListSc Do not edit the class manually. */ - private static ArrayTypeMatchesArrays1 instance; + private static @Nullable ArrayTypeMatchesArrays1 instance = null; protected ArrayTypeMatchesArrays1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 1617fa2f4da..90ef089599a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -11,6 +11,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -39,7 +41,7 @@ public static class ByInt1 extends JsonSchema implements NullSchemaValidator, Bo Do not edit the class manually. */ - private static ByInt1 instance; + private static @Nullable ByInt1 instance = null; protected ByInt1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 10511f576ec..5335882b4eb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -11,6 +11,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -39,7 +41,7 @@ public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, Do not edit the class manually. */ - private static ByNumber1 instance; + private static @Nullable ByNumber1 instance = null; protected ByNumber1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index 2e4775f02a0..df9a2966cfb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -11,6 +11,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -39,7 +41,7 @@ public static class BySmallNumber1 extends JsonSchema implements NullSchemaValid Do not edit the class manually. */ - private static BySmallNumber1 instance; + private static @Nullable BySmallNumber1 instance = null; protected BySmallNumber1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index b4664dd703f..9cde3f8262c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class DateTimeFormat1 extends JsonSchema implements NullSchemaVali Do not edit the class manually. */ - private static DateTimeFormat1 instance; + private static @Nullable DateTimeFormat1 instance = null; protected DateTimeFormat1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index 499ad160224..76e6c160842 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class EmailFormat1 extends JsonSchema implements NullSchemaValidat Do not edit the class manually. */ - private static EmailFormat1 instance; + private static @Nullable EmailFormat1 instance = null; protected EmailFormat1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java index 0f9c461affe..829598dc550 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -29,7 +31,7 @@ public static class EnumWith0DoesNotMatchFalse1 extends JsonSchema implements Nu Do not edit the class manually. */ - private static EnumWith0DoesNotMatchFalse1 instance; + private static @Nullable EnumWith0DoesNotMatchFalse1 instance = null; protected EnumWith0DoesNotMatchFalse1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java index 3b547c80445..5169a41d8f1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -29,7 +31,7 @@ public static class EnumWith1DoesNotMatchTrue1 extends JsonSchema implements Num Do not edit the class manually. */ - private static EnumWith1DoesNotMatchTrue1 instance; + private static @Nullable EnumWith1DoesNotMatchTrue1 instance = null; protected EnumWith1DoesNotMatchTrue1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java index aa0789ea6fa..d24ed4f9165 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -29,7 +31,7 @@ public static class EnumWithEscapedCharacters1 extends JsonSchema implements Str Do not edit the class manually. */ - private static EnumWithEscapedCharacters1 instance; + private static @Nullable EnumWithEscapedCharacters1 instance = null; protected EnumWithEscapedCharacters1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java index 21f0fadfcaa..f6e31e42379 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -29,7 +31,7 @@ public static class EnumWithFalseDoesNotMatch01 extends JsonSchema implements Bo Do not edit the class manually. */ - private static EnumWithFalseDoesNotMatch01 instance; + private static @Nullable EnumWithFalseDoesNotMatch01 instance = null; protected EnumWithFalseDoesNotMatch01() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java index 74682194919..ee7079dc85c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -29,7 +31,7 @@ public static class EnumWithTrueDoesNotMatch11 extends JsonSchema implements Boo Do not edit the class manually. */ - private static EnumWithTrueDoesNotMatch11 instance; + private static @Nullable EnumWithTrueDoesNotMatch11 instance = null; protected EnumWithTrueDoesNotMatch11() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index eb918ac4462..071668a5f42 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -26,7 +28,7 @@ public class EnumsInProperties { public static class Foo extends JsonSchema implements StringSchemaValidator { - private static Foo instance; + private static @Nullable Foo instance = null; protected Foo() { super(new JsonSchemaInfo() @@ -67,7 +69,7 @@ public Object getNewInstance(Object arg, List pathToItem, PathToSchemasM } public static class Bar extends JsonSchema implements StringSchemaValidator { - private static Bar instance; + private static @Nullable Bar instance = null; protected Bar() { super(new JsonSchemaInfo() @@ -149,7 +151,7 @@ public static class EnumsInProperties1 extends JsonSchema implements MapSchemaVa Do not edit the class manually. */ - private static EnumsInProperties1 instance; + private static @Nullable EnumsInProperties1 instance = null; protected EnumsInProperties1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 31dfb4f1f5c..773f51292c4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -74,7 +76,7 @@ public static class ForbiddenProperty1 extends JsonSchema implements NullSchemaV Do not edit the class manually. */ - private static ForbiddenProperty1 instance; + private static @Nullable ForbiddenProperty1 instance = null; protected ForbiddenProperty1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 8232003f6cf..aa80c2d11a9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class HostnameFormat1 extends JsonSchema implements NullSchemaVali Do not edit the class manually. */ - private static HostnameFormat1 instance; + private static @Nullable HostnameFormat1 instance = null; protected HostnameFormat1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java index 567e856ee3a..6f878aa6245 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java @@ -8,6 +8,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -29,7 +31,7 @@ public static class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1 exte Do not edit the class manually. */ - private static InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1 instance; + private static @Nullable InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1 instance = null; protected InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 90cb0806e06..f3583c4527a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -33,7 +35,7 @@ public class InvalidStringValueForDefault { public static class Bar extends JsonSchema implements StringSchemaValidator { - private static Bar instance; + private static @Nullable Bar instance = null; protected Bar() { super(new JsonSchemaInfo() @@ -107,7 +109,7 @@ public static class InvalidStringValueForDefault1 extends JsonSchema implements Do not edit the class manually. */ - private static InvalidStringValueForDefault1 instance; + private static @Nullable InvalidStringValueForDefault1 instance = null; protected InvalidStringValueForDefault1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index 9b7d1ee5945..6de834c3485 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidato Do not edit the class manually. */ - private static Ipv4Format1 instance; + private static @Nullable Ipv4Format1 instance = null; protected Ipv4Format1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index 7f783d25783..6234cedbc30 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidato Do not edit the class manually. */ - private static Ipv6Format1 instance; + private static @Nullable Ipv6Format1 instance = null; protected Ipv6Format1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 01bd1f3866b..8c2024b8c4a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaV Do not edit the class manually. */ - private static JsonPointerFormat1 instance; + private static @Nullable JsonPointerFormat1 instance = null; protected JsonPointerFormat1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 59e9a5da39b..6b3d5a4ab20 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class MaximumValidation1 extends JsonSchema implements NullSchemaV Do not edit the class manually. */ - private static MaximumValidation1 instance; + private static @Nullable MaximumValidation1 instance = null; protected MaximumValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 3ac95d2fa6d..04637ec23fe 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema imp Do not edit the class manually. */ - private static MaximumValidationWithUnsignedInteger1 instance; + private static @Nullable MaximumValidationWithUnsignedInteger1 instance = null; protected MaximumValidationWithUnsignedInteger1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index 4aba4518783..d2a46325ad7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class MaxitemsValidation1 extends JsonSchema implements NullSchema Do not edit the class manually. */ - private static MaxitemsValidation1 instance; + private static @Nullable MaxitemsValidation1 instance = null; protected MaxitemsValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 5661e5e0495..2f811e71b43 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class MaxlengthValidation1 extends JsonSchema implements NullSchem Do not edit the class manually. */ - private static MaxlengthValidation1 instance; + private static @Nullable MaxlengthValidation1 instance = null; protected MaxlengthValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index 1fa9056537c..285a0829140 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema impl Do not edit the class manually. */ - private static Maxproperties0MeansTheObjectIsEmpty1 instance; + private static @Nullable Maxproperties0MeansTheObjectIsEmpty1 instance = null; protected Maxproperties0MeansTheObjectIsEmpty1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index add351a25ca..f43e83129e4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class MaxpropertiesValidation1 extends JsonSchema implements NullS Do not edit the class manually. */ - private static MaxpropertiesValidation1 instance; + private static @Nullable MaxpropertiesValidation1 instance = null; protected MaxpropertiesValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index 4048ad860b8..0584459b588 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class MinimumValidation1 extends JsonSchema implements NullSchemaV Do not edit the class manually. */ - private static MinimumValidation1 instance; + private static @Nullable MinimumValidation1 instance = null; protected MinimumValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index b9d3966da9d..ac8a966bff2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class MinimumValidationWithSignedInteger1 extends JsonSchema imple Do not edit the class manually. */ - private static MinimumValidationWithSignedInteger1 instance; + private static @Nullable MinimumValidationWithSignedInteger1 instance = null; protected MinimumValidationWithSignedInteger1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index 9e14a51baf7..26e9bfa5385 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class MinitemsValidation1 extends JsonSchema implements NullSchema Do not edit the class manually. */ - private static MinitemsValidation1 instance; + private static @Nullable MinitemsValidation1 instance = null; protected MinitemsValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 1745c290a71..5145f1e135b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class MinlengthValidation1 extends JsonSchema implements NullSchem Do not edit the class manually. */ - private static MinlengthValidation1 instance; + private static @Nullable MinlengthValidation1 instance = null; protected MinlengthValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index d6f2fdd3bd8..d60955680f5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class MinpropertiesValidation1 extends JsonSchema implements NullS Do not edit the class manually. */ - private static MinpropertiesValidation1 instance; + private static @Nullable MinpropertiesValidation1 instance = null; protected MinpropertiesValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 301858c8372..a135a84c3ca 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -36,7 +38,7 @@ public static class Schema01 extends NullJsonSchema {} public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -216,7 +218,7 @@ public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema im Do not edit the class manually. */ - private static NestedAllofToCheckValidationSemantics1 instance; + private static @Nullable NestedAllofToCheckValidationSemantics1 instance = null; protected NestedAllofToCheckValidationSemantics1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index f3a891e49e3..214e8e43c6c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -36,7 +38,7 @@ public static class Schema01 extends NullJsonSchema {} public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -216,7 +218,7 @@ public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema im Do not edit the class manually. */ - private static NestedAnyofToCheckValidationSemantics1 instance; + private static @Nullable NestedAnyofToCheckValidationSemantics1 instance = null; protected NestedAnyofToCheckValidationSemantics1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index 7e9ee5ee119..1b33f84f11a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -41,7 +43,7 @@ public static class ItemsListInput { public static class Items2 extends JsonSchema implements ListSchemaValidator { - private static Items2 instance; + private static @Nullable Items2 instance = null; protected Items2() { super(new JsonSchemaInfo() @@ -108,7 +110,7 @@ public static class ItemsListInput1 { public static class Items1 extends JsonSchema implements ListSchemaValidator, ItemsList1> { - private static Items1 instance; + private static @Nullable Items1 instance = null; protected Items1() { super(new JsonSchemaInfo() @@ -175,7 +177,7 @@ public static class ItemsListInput2 { public static class Items extends JsonSchema implements ListSchemaValidator>, ItemsList2> { - private static Items instance; + private static @Nullable Items instance = null; protected Items() { super(new JsonSchemaInfo() @@ -248,7 +250,7 @@ public static class NestedItems1 extends JsonSchema implements ListSchemaValidat Do not edit the class manually. */ - private static NestedItems1 instance; + private static @Nullable NestedItems1 instance = null; protected NestedItems1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index 1ce3354a98f..0c7339edc17 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -36,7 +38,7 @@ public static class Schema01 extends NullJsonSchema {} public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -216,7 +218,7 @@ public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema im Do not edit the class manually. */ - private static NestedOneofToCheckValidationSemantics1 instance; + private static @Nullable NestedOneofToCheckValidationSemantics1 instance = null; protected NestedOneofToCheckValidationSemantics1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index 2a441ff1480..d0142bcd9fa 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -42,7 +44,7 @@ public static class Not1 extends JsonSchema implements NullSchemaValidator, Bool Do not edit the class manually. */ - private static Not1 instance; + private static @Nullable Not1 instance = null; protected Not1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 81080a1aabc..0bce346f507 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -66,7 +68,7 @@ public static class NotMapInput { public static class Not extends JsonSchema implements MapSchemaValidator { - private static Not instance; + private static @Nullable Not instance = null; protected Not() { super(new JsonSchemaInfo() @@ -128,7 +130,7 @@ public static class NotMoreComplexSchema1 extends JsonSchema implements NullSche Do not edit the class manually. */ - private static NotMoreComplexSchema1 instance; + private static @Nullable NotMoreComplexSchema1 instance = null; protected NotMoreComplexSchema1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java index 1238ba53d50..926f7a43dea 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -29,7 +31,7 @@ public static class NulCharactersInStrings1 extends JsonSchema implements String Do not edit the class manually. */ - private static NulCharactersInStrings1 instance; + private static @Nullable NulCharactersInStrings1 instance = null; protected NulCharactersInStrings1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index 9015e6a9f26..a6fd67f7d16 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -83,7 +85,7 @@ public static class ObjectPropertiesValidation1 extends JsonSchema implements Nu Do not edit the class manually. */ - private static ObjectPropertiesValidation1 instance; + private static @Nullable ObjectPropertiesValidation1 instance = null; protected ObjectPropertiesValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index 892c768aef5..52d2f48e7b9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -36,7 +38,7 @@ public static class Schema0 extends IntJsonSchema {} public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema1 instance; + private static @Nullable Schema1 instance = null; protected Schema1() { super(new JsonSchemaInfo() @@ -214,7 +216,7 @@ public static class Oneof1 extends JsonSchema implements NullSchemaValidator, Bo Do not edit the class manually. */ - private static Oneof1 instance; + private static @Nullable Oneof1 instance = null; protected Oneof1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index d0a909be7c4..f983bd6f330 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -65,7 +67,7 @@ public static class Schema0MapInput { public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -272,7 +274,7 @@ public static class Schema1MapInput { public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema1 instance; + private static @Nullable Schema1 instance = null; protected Schema1() { super(new JsonSchemaInfo() @@ -455,7 +457,7 @@ public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaV Do not edit the class manually. */ - private static OneofComplexTypes1 instance; + private static @Nullable OneofComplexTypes1 instance = null; protected OneofComplexTypes1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index 83fe1b39b69..d6746733176 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -32,7 +34,7 @@ public class OneofWithBaseSchema { public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -204,7 +206,7 @@ public Object getNewInstance(Object arg, List pathToItem, PathToSchemasM } public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static Schema1 instance; + private static @Nullable Schema1 instance = null; protected Schema1() { super(new JsonSchemaInfo() @@ -382,7 +384,7 @@ public static class OneofWithBaseSchema1 extends JsonSchema implements StringSch Do not edit the class manually. */ - private static OneofWithBaseSchema1 instance; + private static @Nullable OneofWithBaseSchema1 instance = null; protected OneofWithBaseSchema1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 0defb2ce1fb..5b7c724d010 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -46,7 +48,7 @@ public static class OneofWithEmptySchema1 extends JsonSchema implements NullSche Do not edit the class manually. */ - private static OneofWithEmptySchema1 instance; + private static @Nullable OneofWithEmptySchema1 instance = null; protected OneofWithEmptySchema1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 27e8589e059..c95bfc5b793 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -64,7 +66,7 @@ public static class Schema0MapInput { public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema0 instance; + private static @Nullable Schema0 instance = null; protected Schema0() { super(new JsonSchemaInfo() @@ -271,7 +273,7 @@ public static class Schema1MapInput { public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { - private static Schema1 instance; + private static @Nullable Schema1 instance = null; protected Schema1() { super(new JsonSchemaInfo() @@ -452,7 +454,7 @@ public static class OneofWithRequired1 extends JsonSchema implements MapSchemaVa Do not edit the class manually. */ - private static OneofWithRequired1 instance; + private static @Nullable OneofWithRequired1 instance = null; protected OneofWithRequired1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index 26c01a11cd9..7eaf69513a8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -11,6 +11,8 @@ import java.util.Set; import java.util.UUID; import java.util.regex.Pattern; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -39,7 +41,7 @@ public static class PatternIsNotAnchored1 extends JsonSchema implements NullSche Do not edit the class manually. */ - private static PatternIsNotAnchored1 instance; + private static @Nullable PatternIsNotAnchored1 instance = null; protected PatternIsNotAnchored1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index ca8e5fbc088..a183713e28e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -11,6 +11,8 @@ import java.util.Set; import java.util.UUID; import java.util.regex.Pattern; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -39,7 +41,7 @@ public static class PatternValidation1 extends JsonSchema implements NullSchemaV Do not edit the class manually. */ - private static PatternValidation1 instance; + private static @Nullable PatternValidation1 instance = null; protected PatternValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 21f9a8a381a..1367ef10bdd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -86,7 +88,7 @@ public static class PropertiesWithEscapedCharacters1 extends JsonSchema implemen Do not edit the class manually. */ - private static PropertiesWithEscapedCharacters1 instance; + private static @Nullable PropertiesWithEscapedCharacters1 instance = null; protected PropertiesWithEscapedCharacters1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index e411d623af2..2078e50ee0e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -66,7 +68,7 @@ public static class PropertyNamedRefThatIsNotAReference1 extends JsonSchema impl Do not edit the class manually. */ - private static PropertyNamedRefThatIsNotAReference1 instance; + private static @Nullable PropertyNamedRefThatIsNotAReference1 instance = null; protected PropertyNamedRefThatIsNotAReference1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 6cb7dad2acf..34234d24bd9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -49,7 +51,7 @@ public static class RefInAdditionalproperties1 extends JsonSchema implements Map Do not edit the class manually. */ - private static RefInAdditionalproperties1 instance; + private static @Nullable RefInAdditionalproperties1 instance = null; protected RefInAdditionalproperties1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index 9342f3430fa..47a8365ad10 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class RefInAllof1 extends JsonSchema implements NullSchemaValidato Do not edit the class manually. */ - private static RefInAllof1 instance; + private static @Nullable RefInAllof1 instance = null; protected RefInAllof1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index 7584c5eb76e..16a07e07c02 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class RefInAnyof1 extends JsonSchema implements NullSchemaValidato Do not edit the class manually. */ - private static RefInAnyof1 instance; + private static @Nullable RefInAnyof1 instance = null; protected RefInAnyof1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java index 5732b7bd049..dd5492aa79f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -43,7 +45,7 @@ public static class RefInItems1 extends JsonSchema implements ListSchemaValidato Do not edit the class manually. */ - private static RefInItems1 instance; + private static @Nullable RefInItems1 instance = null; protected RefInItems1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index d3c85a028a9..bbd5eaa585e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class RefInNot1 extends JsonSchema implements NullSchemaValidator, Do not edit the class manually. */ - private static RefInNot1 instance; + private static @Nullable RefInNot1 instance = null; protected RefInNot1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index ea2cca6d2a8..3fc18d2e356 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class RefInOneof1 extends JsonSchema implements NullSchemaValidato Do not edit the class manually. */ - private static RefInOneof1 instance; + private static @Nullable RefInOneof1 instance = null; protected RefInOneof1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index 4bb6912bf0b..b568933359a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -68,7 +70,7 @@ public static class RefInProperty1 extends JsonSchema implements NullSchemaValid Do not edit the class manually. */ - private static RefInProperty1 instance; + private static @Nullable RefInProperty1 instance = null; protected RefInProperty1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 5c2bea749d9..3a0e96b58ed 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -72,7 +74,7 @@ public static class RequiredDefaultValidation1 extends JsonSchema implements Nul Do not edit the class manually. */ - private static RequiredDefaultValidation1 instance; + private static @Nullable RequiredDefaultValidation1 instance = null; protected RequiredDefaultValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index f4e310abc42..aee18fa2fde 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -81,7 +83,7 @@ public static class RequiredValidation1 extends JsonSchema implements NullSchema Do not edit the class manually. */ - private static RequiredValidation1 instance; + private static @Nullable RequiredValidation1 instance = null; protected RequiredValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index bed0df83550..97d388d266b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -72,7 +74,7 @@ public static class RequiredWithEmptyArray1 extends JsonSchema implements NullSc Do not edit the class manually. */ - private static RequiredWithEmptyArray1 instance; + private static @Nullable RequiredWithEmptyArray1 instance = null; protected RequiredWithEmptyArray1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index ab9bda16152..44ce643cf32 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -66,7 +68,7 @@ public static class RequiredWithEscapedCharacters1 extends JsonSchema implements Do not edit the class manually. */ - private static RequiredWithEscapedCharacters1 instance; + private static @Nullable RequiredWithEscapedCharacters1 instance = null; protected RequiredWithEscapedCharacters1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java index 5472afa0ae5..5c14bae387d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -29,7 +31,7 @@ public static class SimpleEnumValidation1 extends JsonSchema implements NumberSc Do not edit the class manually. */ - private static SimpleEnumValidation1 instance; + private static @Nullable SimpleEnumValidation1 instance = null; protected SimpleEnumValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 693324d0e5d..6e1e61efc35 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -25,7 +27,7 @@ public class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing { public static class Alpha extends JsonSchema implements NumberSchemaValidator { - private static Alpha instance; + private static @Nullable Alpha instance = null; protected Alpha() { super(new JsonSchemaInfo() @@ -117,7 +119,7 @@ public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1 ex Do not edit the class manually. */ - private static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1 instance; + private static @Nullable TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1 instance = null; protected TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index 569f94d5fd6..408dbc62f15 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class UniqueitemsFalseValidation1 extends JsonSchema implements Nu Do not edit the class manually. */ - private static UniqueitemsFalseValidation1 instance; + private static @Nullable UniqueitemsFalseValidation1 instance = null; protected UniqueitemsFalseValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 317cf9c3651..8d5ba9e580c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class UniqueitemsValidation1 extends JsonSchema implements NullSch Do not edit the class manually. */ - private static UniqueitemsValidation1 instance; + private static @Nullable UniqueitemsValidation1 instance = null; protected UniqueitemsValidation1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index 85c4e34acf7..e1402a5f95e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class UriFormat1 extends JsonSchema implements NullSchemaValidator Do not edit the class manually. */ - private static UriFormat1 instance; + private static @Nullable UriFormat1 instance = null; protected UriFormat1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index c517ee5d9ea..3d7a915a9d6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class UriReferenceFormat1 extends JsonSchema implements NullSchema Do not edit the class manually. */ - private static UriReferenceFormat1 instance; + private static @Nullable UriReferenceFormat1 instance = null; protected UriReferenceFormat1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index dd2ffd0246d..b6e941e00e9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -10,6 +10,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; @@ -38,7 +40,7 @@ public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaV Do not edit the class manually. */ - private static UriTemplateFormat1 instance; + private static @Nullable UriTemplateFormat1 instance = null; protected UriTemplateFormat1() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index 994aa4d4998..94994d47ab0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -16,6 +16,8 @@ import org.openapijsonschematools.client.schemas.validation.ListSchemaValidator; import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; import java.time.ZonedDateTime; @@ -30,7 +32,7 @@ import java.util.UUID; public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static AnyTypeJsonSchema instance; + private static @Nullable AnyTypeJsonSchema instance = null; protected AnyTypeJsonSchema() { super(new JsonSchemaInfo()); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java index e550fed4598..d9cde59919c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java @@ -11,6 +11,8 @@ import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -21,7 +23,7 @@ import java.util.Set; public class BooleanJsonSchema extends JsonSchema implements BooleanSchemaValidator { - private static BooleanJsonSchema instance; + private static @Nullable BooleanJsonSchema instance = null; protected BooleanJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java index 56882f6403b..ce83f017101 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -5,13 +5,12 @@ import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.schemas.validation.JsonSchema; import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.KeywordEntry; import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; import org.openapijsonschematools.client.schemas.validation.StringSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.TypeValidator; -import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; import java.util.HashSet; @@ -23,7 +22,7 @@ import java.util.Set; public class DateJsonSchema extends JsonSchema implements StringSchemaValidator { - private static DateJsonSchema instance; + private static @Nullable DateJsonSchema instance = null; protected DateJsonSchema() { super(new JsonSchemaInfo() @@ -40,12 +39,12 @@ public static DateJsonSchema getInstance() { } @Override - public String getNewInstance(String arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @NonNull String getNewInstance(@NonNull String arg, List pathToItem, PathToSchemasMap pathToSchemas) { return arg; } @Override - public String validate(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public @NonNull String validate(@NonNull String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); String castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -55,7 +54,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); } - public String validate(LocalDate arg, SchemaConfiguration configuration) throws ValidationException { + public @NonNull String validate(@NonNull LocalDate arg, SchemaConfiguration configuration) throws ValidationException { return validate(arg.toString(), configuration); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java index 8a2dcd8ba4b..ad30db1e8cb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java @@ -12,6 +12,8 @@ import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.ZonedDateTime; import java.util.HashSet; @@ -23,7 +25,7 @@ import java.util.Set; public class DateTimeJsonSchema extends JsonSchema implements StringSchemaValidator { - private static DateTimeJsonSchema instance; + private static @Nullable DateTimeJsonSchema instance = null; protected DateTimeJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java index a67ef350218..b3a61c3249a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java @@ -12,6 +12,8 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Set; public class DecimalJsonSchema extends JsonSchema implements StringSchemaValidator { - private static DecimalJsonSchema instance; + private static @Nullable DecimalJsonSchema instance = null; protected DecimalJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java index 00afd29ae4c..d973116034c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java @@ -12,6 +12,8 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Set; public class DoubleJsonSchema extends JsonSchema implements NumberSchemaValidator { - private static DoubleJsonSchema instance; + private static @Nullable DoubleJsonSchema instance = null; protected DoubleJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java index eb7da1dd8de..5581eda320e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java @@ -12,6 +12,8 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Set; public class FloatJsonSchema extends JsonSchema implements NumberSchemaValidator { - private static FloatJsonSchema instance; + private static @Nullable FloatJsonSchema instance = null; protected FloatJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java index f5a2f1872d7..9be368c67c1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java @@ -12,6 +12,8 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Map; public class Int32JsonSchema extends JsonSchema implements NumberSchemaValidator { - private static Int32JsonSchema instance; + private static @Nullable Int32JsonSchema instance = null; protected Int32JsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java index ad2cfee3c81..a6d94c7cecb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java @@ -12,6 +12,8 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Map; public class Int64JsonSchema extends JsonSchema implements NumberSchemaValidator { - private static Int64JsonSchema instance; + private static @Nullable Int64JsonSchema instance = null; protected Int64JsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java index 70e26275d1c..ec42620c8c2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java @@ -12,6 +12,8 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Map; public class IntJsonSchema extends JsonSchema implements NumberSchemaValidator { - private static IntJsonSchema instance; + private static @Nullable IntJsonSchema instance = null; protected IntJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java index 7d171a1937d..22525fb2002 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java @@ -10,6 +10,8 @@ import org.openapijsonschematools.client.schemas.validation.ListSchemaValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.HashSet; @@ -19,7 +21,7 @@ import java.util.Set; public class ListJsonSchema extends JsonSchema implements ListSchemaValidator> { - private static ListJsonSchema instance; + private static @Nullable ListJsonSchema instance = null; protected ListJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index 4c3aa27719a..dcf00b8fd39 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -10,6 +10,8 @@ import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.HashSet; @@ -21,7 +23,7 @@ import java.util.Set; public class MapJsonSchema extends JsonSchema implements MapSchemaValidator> { - private static MapJsonSchema instance; + private static @Nullable MapJsonSchema instance = null; protected MapJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index 81217f8c4cb..9afa456f949 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -16,6 +16,8 @@ import org.openapijsonschematools.client.schemas.validation.ListSchemaValidator; import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; import java.time.ZonedDateTime; @@ -30,7 +32,7 @@ import java.util.UUID; public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static NotAnyTypeJsonSchema instance; + private static @Nullable NotAnyTypeJsonSchema instance = null; protected NotAnyTypeJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java index 2d6938a4b22..8b1444d2de7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java @@ -11,6 +11,8 @@ import org.openapijsonschematools.client.schemas.validation.NullSchemaValidator; import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -21,7 +23,7 @@ import java.util.Set; public class NullJsonSchema extends JsonSchema implements NullSchemaValidator { - private static NullJsonSchema instance; + private static @Nullable NullJsonSchema instance = null; protected NullJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java index 87a15430a93..838db4ea6a0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java @@ -11,6 +11,8 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -21,7 +23,7 @@ import java.util.Map; public class NumberJsonSchema extends JsonSchema implements NumberSchemaValidator { - private static NumberJsonSchema instance; + private static @Nullable NumberJsonSchema instance = null; protected NumberJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java index 7c46f5ba114..c49fee64efb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java @@ -11,6 +11,8 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; import java.time.ZonedDateTime; @@ -24,7 +26,7 @@ import java.util.UUID; public class StringJsonSchema extends JsonSchema implements StringSchemaValidator { - private static StringJsonSchema instance; + private static @Nullable StringJsonSchema instance = null; protected StringJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java index 48c8acacb80..bc37c792a0e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java @@ -12,6 +12,8 @@ import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -23,7 +25,7 @@ import java.util.UUID; public class UuidJsonSchema extends JsonSchema implements StringSchemaValidator { - private static UuidJsonSchema instance; + private static @Nullable UuidJsonSchema instance = null; protected UuidJsonSchema() { super(new JsonSchemaInfo() diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 87ee535a81b..46a10c6217a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -2,6 +2,8 @@ import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; import java.time.LocalDate; @@ -16,31 +18,31 @@ import java.util.regex.Pattern; public abstract class JsonSchema { - public final Set> type; - public final String format; - public final Class items; - public final Map> properties; - public final Set required; - public final Number exclusiveMaximum; - public final Number exclusiveMinimum; - public final Integer maxItems; - public final Integer minItems; - public final Integer maxLength; - public final Integer minLength; - public final Integer maxProperties; - public final Integer minProperties; - public final Number maximum; - public final Number minimum; - public final BigDecimal multipleOf; - public final Class additionalProperties; - public final List> allOf; - public final List> anyOf; - public final List> oneOf; - public final Class not; - public final Boolean uniqueItems; - public final Set enumValues; - public final Pattern pattern; - private final LinkedHashMap keywordToValidator; + public final @Nullable Set> type; + public final @Nullable String format; + public final @Nullable Class items; + public final @Nullable Map> properties; + public final @Nullable Set required; + public final @Nullable Number exclusiveMaximum; + public final @Nullable Number exclusiveMinimum; + public final @Nullable Integer maxItems; + public final @Nullable Integer minItems; + public final @Nullable Integer maxLength; + public final @Nullable Integer minLength; + public final @Nullable Integer maxProperties; + public final @Nullable Integer minProperties; + public final @Nullable Number maximum; + public final @Nullable Number minimum; + public final @Nullable BigDecimal multipleOf; + public final @Nullable Class additionalProperties; + public final @Nullable List> allOf; + public final @Nullable List> anyOf; + public final @Nullable List> oneOf; + public final @Nullable Class not; + public final @Nullable Boolean uniqueItems; + public final @Nullable Set enumValues; + public final @Nullable Pattern pattern; + private final @NonNull LinkedHashMap keywordToValidator; protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { LinkedHashMap keywordToValidator = new LinkedHashMap<>(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java index 0d069ea2f99..c1b76107a80 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java @@ -1,4 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; import java.util.List; @@ -7,123 +9,123 @@ import java.util.regex.Pattern; public class JsonSchemaInfo { - public Set> type; - public JsonSchemaInfo type(Set> type) { + public @Nullable Set> type = null; + public JsonSchemaInfo type(@NonNull Set> type) { this.type = type; return this; } - public String format; - public JsonSchemaInfo format(String format) { + public @Nullable String format = null; + public JsonSchemaInfo format(@NonNull String format) { this.format = format; return this; } - public Class items; - public JsonSchemaInfo items(Class items) { + public @Nullable Class items = null; + public JsonSchemaInfo items(@NonNull Class items) { this.items = items; return this; } - public Map> properties; - public JsonSchemaInfo properties(Map> properties) { + public @Nullable Map> properties = null; + public JsonSchemaInfo properties(@NonNull Map> properties) { this.properties = properties; return this; } - public Set required; - public JsonSchemaInfo required(Set required) { + public @Nullable Set required = null; + public JsonSchemaInfo required(@NonNull Set required) { this.required = required; return this; } - public Number exclusiveMaximum; - public JsonSchemaInfo exclusiveMaximum(Number exclusiveMaximum) { + public @Nullable Number exclusiveMaximum = null; + public JsonSchemaInfo exclusiveMaximum(@NonNull Number exclusiveMaximum) { this.exclusiveMaximum = exclusiveMaximum; return this; } - public Number exclusiveMinimum; - public JsonSchemaInfo exclusiveMinimum(Number exclusiveMinimum) { + public @Nullable Number exclusiveMinimum = null; + public JsonSchemaInfo exclusiveMinimum(@NonNull Number exclusiveMinimum) { this.exclusiveMinimum = exclusiveMinimum; return this; } - public Integer maxItems; - public JsonSchemaInfo maxItems(Integer maxItems) { + public @Nullable Integer maxItems = null; + public JsonSchemaInfo maxItems(@NonNull Integer maxItems) { this.maxItems = maxItems; return this; } - public Integer minItems; - public JsonSchemaInfo minItems(Integer minItems) { + public @Nullable Integer minItems = null; + public JsonSchemaInfo minItems(@NonNull Integer minItems) { this.minItems = minItems; return this; } - public Integer maxLength; - public JsonSchemaInfo maxLength(Integer maxLength) { + public @Nullable Integer maxLength = null; + public JsonSchemaInfo maxLength(@NonNull Integer maxLength) { this.maxLength = maxLength; return this; } - public Integer minLength; - public JsonSchemaInfo minLength(Integer minLength) { + public @Nullable Integer minLength = null; + public JsonSchemaInfo minLength(@NonNull Integer minLength) { this.minLength = minLength; return this; } - public Integer maxProperties; - public JsonSchemaInfo maxProperties(Integer maxProperties) { + public @Nullable Integer maxProperties = null; + public JsonSchemaInfo maxProperties(@NonNull Integer maxProperties) { this.maxProperties = maxProperties; return this; } - public Integer minProperties; - public JsonSchemaInfo minProperties(Integer minProperties) { + public @Nullable Integer minProperties = null; + public JsonSchemaInfo minProperties(@NonNull Integer minProperties) { this.minProperties = minProperties; return this; } - public Number maximum; - public JsonSchemaInfo maximum(Number maximum) { + public @Nullable Number maximum = null; + public JsonSchemaInfo maximum(@NonNull Number maximum) { this.maximum = maximum; return this; } - public Number minimum; - public JsonSchemaInfo minimum(Number minimum) { + public @Nullable Number minimum = null; + public JsonSchemaInfo minimum(@NonNull Number minimum) { this.minimum = minimum; return this; } - public BigDecimal multipleOf; - public JsonSchemaInfo multipleOf(BigDecimal multipleOf) { + public @Nullable BigDecimal multipleOf = null; + public JsonSchemaInfo multipleOf(@NonNull BigDecimal multipleOf) { this.multipleOf = multipleOf; return this; } - public Class additionalProperties; - public JsonSchemaInfo additionalProperties(Class additionalProperties) { + public @Nullable Class additionalProperties; + public JsonSchemaInfo additionalProperties(@NonNull Class additionalProperties) { this.additionalProperties = additionalProperties; return this; } - public List> allOf; - public JsonSchemaInfo allOf(List> allOf) { + public @Nullable List> allOf = null; + public JsonSchemaInfo allOf(@NonNull List> allOf) { this.allOf = allOf; return this; } - public List> anyOf; - public JsonSchemaInfo anyOf(List> anyOf) { + public @Nullable List> anyOf = null; + public JsonSchemaInfo anyOf(@NonNull List> anyOf) { this.anyOf = anyOf; return this; } - public List> oneOf; - public JsonSchemaInfo oneOf(List> oneOf) { + public @Nullable List> oneOf = null; + public JsonSchemaInfo oneOf(@NonNull List> oneOf) { this.oneOf = oneOf; return this; } - public Class not; - public JsonSchemaInfo not(Class not) { + public @Nullable Class not = null; + public JsonSchemaInfo not(@NonNull Class not) { this.not = not; return this; } - public Boolean uniqueItems; - public JsonSchemaInfo uniqueItems(Boolean uniqueItems) { + public @Nullable Boolean uniqueItems = null; + public JsonSchemaInfo uniqueItems(@NonNull Boolean uniqueItems) { this.uniqueItems = uniqueItems; return this; } - public Set enumValues; - public JsonSchemaInfo enumValues(Set enumValues) { + public @Nullable Set enumValues = null; + public JsonSchemaInfo enumValues(@NonNull Set enumValues) { this.enumValues = enumValues; return this; } - public Pattern pattern; - public JsonSchemaInfo pattern(Pattern pattern) { + public @Nullable Pattern pattern = null; + public JsonSchemaInfo pattern(@NonNull Pattern pattern) { this.pattern = pattern; return this; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index 2622abe53e5..0b8acd75d9f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -4,6 +4,8 @@ import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; import java.time.ZonedDateTime; @@ -18,7 +20,7 @@ import java.util.UUID; public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static UnsetAnyTypeJsonSchema instance; + private static @Nullable UnsetAnyTypeJsonSchema instance = null; protected UnsetAnyTypeJsonSchema() { super(new JsonSchemaInfo()); diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java b/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java index c0e7fcc7643..c644005087d 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java @@ -1597,6 +1597,8 @@ private void addCustomSchemaImports(Set imports, CodegenSchema schema) { imports.add("import "+packageName + ".schemas.validation.PathToSchemasMap;"); // for getNewInstance imports.add("import "+packageName + ".schemas.validation.ValidationMetadata;"); // for getNewInstance imports.add("import "+packageName + ".configurations.JsonSchemaKeywordFlags;"); // for getNewInstance + imports.add("import org.checkerframework.checker.nullness.qual.NonNull;"); + imports.add("import org.checkerframework.checker.nullness.qual.Nullable;"); } private void addBooleanSchemaImports(Set imports, CodegenSchema schema) { diff --git a/src/main/resources/java/pom.hbs b/src/main/resources/java/pom.hbs index 1e0ba83059c..26e0d42e7d5 100644 --- a/src/main/resources/java/pom.hbs +++ b/src/main/resources/java/pom.hbs @@ -54,9 +54,20 @@ -Xlint:all -J-Xss4m + + + org.checkerframework + checker + ${checker-version} + + + + + org.checkerframework.checker.nullness.NullnessChecker + + - org.apache.maven.plugins maven-enforcer-plugin @@ -220,13 +231,17 @@ ${swagger-annotations-version} - + - com.google.code.findbugs - jsr305 - 3.0.2 + org.checkerframework + checker-qual + ${checker-version} + + + org.checkerframework + checker + ${checker-version} - @@ -317,6 +332,7 @@ 17 UTF-8 1.6.3 + 3.35.0 1.19.4 2.12.6 2.12.6.1 diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs index d20daedd22d..ed0d6c667fd 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs @@ -17,7 +17,7 @@ public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements Nu {{/if}} */ {{/if}} - private static {{jsonPathPiece.camelCase}} instance; + private static @Nullable {{jsonPathPiece.camelCase}} instance = null; protected {{../jsonPathPiece.camelCase}}() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_boolean.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_boolean.hbs index 83daa52d9f7..5202418cf36 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_boolean.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_boolean.hbs @@ -13,7 +13,7 @@ public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements Bo {{/if}} */ {{/if}} - private static {{jsonPathPiece.camelCase}} instance; + private static @Nullable {{jsonPathPiece.camelCase}} instance = null; protected {{../jsonPathPiece.camelCase}}() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_list.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_list.hbs index 68ecae1d8c7..01cccab64dd 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_list.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_list.hbs @@ -13,7 +13,7 @@ public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements Li {{/if}} */ {{/if}} - private static {{jsonPathPiece.camelCase}} instance; + private static @Nullable {{jsonPathPiece.camelCase}} instance = null; protected {{../jsonPathPiece.camelCase}}() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs index 8f5de98e12e..2d9f3230d1a 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs @@ -13,7 +13,7 @@ public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements Ma {{/if}} */ {{/if}} - private static {{jsonPathPiece.camelCase}} instance; + private static @Nullable {{jsonPathPiece.camelCase}} instance = null; protected {{../jsonPathPiece.camelCase}}() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_null.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_null.hbs index 099e5ec4c1d..fb3007fe179 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_null.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_null.hbs @@ -13,7 +13,7 @@ public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements Nu {{/if}} */ {{/if}} - private static {{jsonPathPiece.camelCase}} instance; + private static @Nullable {{jsonPathPiece.camelCase}} instance = null; protected {{../jsonPathPiece.camelCase}}() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_number.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_number.hbs index 53d54ccac5d..0c4103f1a7c 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_number.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_number.hbs @@ -13,7 +13,7 @@ public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements Nu {{/if}} */ {{/if}} - private static {{jsonPathPiece.camelCase}} instance; + private static @Nullable {{jsonPathPiece.camelCase}} instance = null; protected {{../jsonPathPiece.camelCase}}() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_string.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_string.hbs index 7997b69df62..04e6b04d7c5 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_string.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_string.hbs @@ -13,7 +13,7 @@ public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements St {{/if}} */ {{/if}} - private static {{jsonPathPiece.camelCase}} instance; + private static @Nullable {{jsonPathPiece.camelCase}} instance = null; protected {{../jsonPathPiece.camelCase}}() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs index 4b1006a2d4a..362934004ae 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs @@ -16,6 +16,8 @@ import {{{packageName}}}.schemas.validation.StringSchemaValidator; import {{{packageName}}}.schemas.validation.ListSchemaValidator; import {{{packageName}}}.schemas.validation.MapSchemaValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; import java.time.ZonedDateTime; @@ -30,7 +32,7 @@ import java.util.Objects; import java.util.UUID; public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static AnyTypeJsonSchema instance; + private static @Nullable AnyTypeJsonSchema instance = null; protected AnyTypeJsonSchema() { super(new JsonSchemaInfo()); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs index abe93b769bf..b03b01fab3d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs @@ -11,6 +11,8 @@ import {{{packageName}}}.schemas.validation.PathToSchemasMap; import {{{packageName}}}.schemas.validation.BooleanSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -21,7 +23,7 @@ import java.util.Objects; import java.util.Set; public class BooleanJsonSchema extends JsonSchema implements BooleanSchemaValidator { - private static BooleanJsonSchema instance; + private static @Nullable BooleanJsonSchema instance = null; protected BooleanJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs index 22f9b5910f3..646ee766871 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs @@ -5,13 +5,12 @@ import {{{packageName}}}.configurations.SchemaConfiguration; import {{{packageName}}}.exceptions.InvalidTypeException; import {{{packageName}}}.schemas.validation.JsonSchema; import {{{packageName}}}.schemas.validation.JsonSchemaInfo; -import {{{packageName}}}.schemas.validation.KeywordEntry; import {{{packageName}}}.schemas.validation.PathToSchemasMap; import {{{packageName}}}.schemas.validation.StringSchemaValidator; -import {{{packageName}}}.schemas.validation.TypeValidator; -import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; import java.util.HashSet; @@ -23,7 +22,7 @@ import java.util.Objects; import java.util.Set; public class DateJsonSchema extends JsonSchema implements StringSchemaValidator { - private static DateJsonSchema instance; + private static @Nullable DateJsonSchema instance = null; protected DateJsonSchema() { super(new JsonSchemaInfo() @@ -40,12 +39,12 @@ public class DateJsonSchema extends JsonSchema implements StringSchemaValidator } @Override - public String getNewInstance(String arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @NonNull String getNewInstance(@NonNull String arg, List pathToItem, PathToSchemasMap pathToSchemas) { return arg; } @Override - public String validate(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public @NonNull String validate(@NonNull String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); String castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -55,7 +54,7 @@ public class DateJsonSchema extends JsonSchema implements StringSchemaValidator return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); } - public String validate(LocalDate arg, SchemaConfiguration configuration) throws ValidationException { + public @NonNull String validate(@NonNull LocalDate arg, SchemaConfiguration configuration) throws ValidationException { return validate(arg.toString(), configuration); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs index f28d2851f70..577851be601 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs @@ -12,6 +12,8 @@ import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.ZonedDateTime; import java.util.HashSet; @@ -23,7 +25,7 @@ import java.util.Objects; import java.util.Set; public class DateTimeJsonSchema extends JsonSchema implements StringSchemaValidator { - private static DateTimeJsonSchema instance; + private static @Nullable DateTimeJsonSchema instance = null; protected DateTimeJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs index 607327f7cfe..c1232d15f41 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs @@ -12,6 +12,8 @@ import {{{packageName}}}.schemas.validation.StringSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Objects; import java.util.Set; public class DecimalJsonSchema extends JsonSchema implements StringSchemaValidator { - private static DecimalJsonSchema instance; + private static @Nullable DecimalJsonSchema instance = null; protected DecimalJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs index 7fd14b0883d..6c699e13f91 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs @@ -12,6 +12,8 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Objects; import java.util.Set; public class DoubleJsonSchema extends JsonSchema implements NumberSchemaValidator { - private static DoubleJsonSchema instance; + private static @Nullable DoubleJsonSchema instance = null; protected DoubleJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs index 2f8f9435958..c9637c419e0 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs @@ -12,6 +12,8 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Objects; import java.util.Set; public class FloatJsonSchema extends JsonSchema implements NumberSchemaValidator { - private static FloatJsonSchema instance; + private static @Nullable FloatJsonSchema instance = null; protected FloatJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs index d77737e3c60..027212b2b29 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs @@ -12,6 +12,8 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Set; import java.util.Map; public class Int32JsonSchema extends JsonSchema implements NumberSchemaValidator { - private static Int32JsonSchema instance; + private static @Nullable Int32JsonSchema instance = null; protected Int32JsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs index b47428525f5..3956f35d27b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs @@ -12,6 +12,8 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Set; import java.util.Map; public class Int64JsonSchema extends JsonSchema implements NumberSchemaValidator { - private static Int64JsonSchema instance; + private static @Nullable Int64JsonSchema instance = null; protected Int64JsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs index c250c0a48a6..fbe560b484b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs @@ -12,6 +12,8 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -22,7 +24,7 @@ import java.util.Set; import java.util.Map; public class IntJsonSchema extends JsonSchema implements NumberSchemaValidator { - private static IntJsonSchema instance; + private static @Nullable IntJsonSchema instance = null; protected IntJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs index c8d5b45c8a4..18c51374300 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs @@ -10,6 +10,8 @@ import {{{packageName}}}.schemas.validation.PathToSchemasMap; import {{{packageName}}}.schemas.validation.ListSchemaValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.HashSet; @@ -19,7 +21,7 @@ import java.util.Objects; import java.util.Set; public class ListJsonSchema extends JsonSchema implements ListSchemaValidator> { - private static ListJsonSchema instance; + private static @Nullable ListJsonSchema instance = null; protected ListJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs index 2927ad674dd..001fbc807e9 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs @@ -10,6 +10,8 @@ import {{{packageName}}}.schemas.validation.PathToSchemasMap; import {{{packageName}}}.schemas.validation.MapSchemaValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.HashSet; @@ -21,7 +23,7 @@ import java.util.Objects; import java.util.Set; public class MapJsonSchema extends JsonSchema implements MapSchemaValidator> { - private static MapJsonSchema instance; + private static @Nullable MapJsonSchema instance = null; protected MapJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs index 114b7fbb9bb..5ca7955332a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs @@ -16,6 +16,8 @@ import {{{packageName}}}.schemas.validation.StringSchemaValidator; import {{{packageName}}}.schemas.validation.ListSchemaValidator; import {{{packageName}}}.schemas.validation.MapSchemaValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; import java.time.ZonedDateTime; @@ -30,7 +32,7 @@ import java.util.Objects; import java.util.UUID; public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static NotAnyTypeJsonSchema instance; + private static @Nullable NotAnyTypeJsonSchema instance = null; protected NotAnyTypeJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs index ab33635a16d..97e2312878b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs @@ -11,6 +11,8 @@ import {{{packageName}}}.schemas.validation.PathToSchemasMap; import {{{packageName}}}.schemas.validation.NullSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -21,7 +23,7 @@ import java.util.Objects; import java.util.Set; public class NullJsonSchema extends JsonSchema implements NullSchemaValidator { - private static NullJsonSchema instance; + private static @Nullable NullJsonSchema instance = null; protected NullJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs index 09b5883bf89..83d453bad11 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs @@ -11,6 +11,8 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -21,7 +23,7 @@ import java.util.Set; import java.util.Map; public class NumberJsonSchema extends JsonSchema implements NumberSchemaValidator { - private static NumberJsonSchema instance; + private static @Nullable NumberJsonSchema instance = null; protected NumberJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs index f2ef9176b77..5b2449975ef 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs @@ -11,6 +11,8 @@ import {{{packageName}}}.schemas.validation.StringSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; import java.time.ZonedDateTime; @@ -24,7 +26,7 @@ import java.util.Map; import java.util.UUID; public class StringJsonSchema extends JsonSchema implements StringSchemaValidator { - private static StringJsonSchema instance; + private static @Nullable StringJsonSchema instance = null; protected StringJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs index 462b953cb06..65838956e6b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs @@ -12,6 +12,8 @@ import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.LinkedHashMap; @@ -23,7 +25,7 @@ import java.util.Set; import java.util.UUID; public class UuidJsonSchema extends JsonSchema implements StringSchemaValidator { - private static UuidJsonSchema instance; + private static @Nullable UuidJsonSchema instance = null; protected UuidJsonSchema() { super(new JsonSchemaInfo() diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index cfd25b75bab..e38ff5129cf 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -2,6 +2,8 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.exceptions.InvalidTypeException; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; import java.time.LocalDate; @@ -16,31 +18,31 @@ import java.util.UUID; import java.util.regex.Pattern; public abstract class JsonSchema { - public final Set> type; - public final String format; - public final Class items; - public final Map> properties; - public final Set required; - public final Number exclusiveMaximum; - public final Number exclusiveMinimum; - public final Integer maxItems; - public final Integer minItems; - public final Integer maxLength; - public final Integer minLength; - public final Integer maxProperties; - public final Integer minProperties; - public final Number maximum; - public final Number minimum; - public final BigDecimal multipleOf; - public final Class additionalProperties; - public final List> allOf; - public final List> anyOf; - public final List> oneOf; - public final Class not; - public final Boolean uniqueItems; - public final Set enumValues; - public final Pattern pattern; - private final LinkedHashMap keywordToValidator; + public final @Nullable Set> type; + public final @Nullable String format; + public final @Nullable Class items; + public final @Nullable Map> properties; + public final @Nullable Set required; + public final @Nullable Number exclusiveMaximum; + public final @Nullable Number exclusiveMinimum; + public final @Nullable Integer maxItems; + public final @Nullable Integer minItems; + public final @Nullable Integer maxLength; + public final @Nullable Integer minLength; + public final @Nullable Integer maxProperties; + public final @Nullable Integer minProperties; + public final @Nullable Number maximum; + public final @Nullable Number minimum; + public final @Nullable BigDecimal multipleOf; + public final @Nullable Class additionalProperties; + public final @Nullable List> allOf; + public final @Nullable List> anyOf; + public final @Nullable List> oneOf; + public final @Nullable Class not; + public final @Nullable Boolean uniqueItems; + public final @Nullable Set enumValues; + public final @Nullable Pattern pattern; + private final @NonNull LinkedHashMap keywordToValidator; protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { LinkedHashMap keywordToValidator = new LinkedHashMap<>(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs index 673f607b31b..ad8d1f4d33b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs @@ -1,4 +1,6 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; import java.util.List; @@ -7,123 +9,123 @@ import java.util.Set; import java.util.regex.Pattern; public class JsonSchemaInfo { - public Set> type; - public JsonSchemaInfo type(Set> type) { + public @Nullable Set> type = null; + public JsonSchemaInfo type(@NonNull Set> type) { this.type = type; return this; } - public String format; - public JsonSchemaInfo format(String format) { + public @Nullable String format = null; + public JsonSchemaInfo format(@NonNull String format) { this.format = format; return this; } - public Class items; - public JsonSchemaInfo items(Class items) { + public @Nullable Class items = null; + public JsonSchemaInfo items(@NonNull Class items) { this.items = items; return this; } - public Map> properties; - public JsonSchemaInfo properties(Map> properties) { + public @Nullable Map> properties = null; + public JsonSchemaInfo properties(@NonNull Map> properties) { this.properties = properties; return this; } - public Set required; - public JsonSchemaInfo required(Set required) { + public @Nullable Set required = null; + public JsonSchemaInfo required(@NonNull Set required) { this.required = required; return this; } - public Number exclusiveMaximum; - public JsonSchemaInfo exclusiveMaximum(Number exclusiveMaximum) { + public @Nullable Number exclusiveMaximum = null; + public JsonSchemaInfo exclusiveMaximum(@NonNull Number exclusiveMaximum) { this.exclusiveMaximum = exclusiveMaximum; return this; } - public Number exclusiveMinimum; - public JsonSchemaInfo exclusiveMinimum(Number exclusiveMinimum) { + public @Nullable Number exclusiveMinimum = null; + public JsonSchemaInfo exclusiveMinimum(@NonNull Number exclusiveMinimum) { this.exclusiveMinimum = exclusiveMinimum; return this; } - public Integer maxItems; - public JsonSchemaInfo maxItems(Integer maxItems) { + public @Nullable Integer maxItems = null; + public JsonSchemaInfo maxItems(@NonNull Integer maxItems) { this.maxItems = maxItems; return this; } - public Integer minItems; - public JsonSchemaInfo minItems(Integer minItems) { + public @Nullable Integer minItems = null; + public JsonSchemaInfo minItems(@NonNull Integer minItems) { this.minItems = minItems; return this; } - public Integer maxLength; - public JsonSchemaInfo maxLength(Integer maxLength) { + public @Nullable Integer maxLength = null; + public JsonSchemaInfo maxLength(@NonNull Integer maxLength) { this.maxLength = maxLength; return this; } - public Integer minLength; - public JsonSchemaInfo minLength(Integer minLength) { + public @Nullable Integer minLength = null; + public JsonSchemaInfo minLength(@NonNull Integer minLength) { this.minLength = minLength; return this; } - public Integer maxProperties; - public JsonSchemaInfo maxProperties(Integer maxProperties) { + public @Nullable Integer maxProperties = null; + public JsonSchemaInfo maxProperties(@NonNull Integer maxProperties) { this.maxProperties = maxProperties; return this; } - public Integer minProperties; - public JsonSchemaInfo minProperties(Integer minProperties) { + public @Nullable Integer minProperties = null; + public JsonSchemaInfo minProperties(@NonNull Integer minProperties) { this.minProperties = minProperties; return this; } - public Number maximum; - public JsonSchemaInfo maximum(Number maximum) { + public @Nullable Number maximum = null; + public JsonSchemaInfo maximum(@NonNull Number maximum) { this.maximum = maximum; return this; } - public Number minimum; - public JsonSchemaInfo minimum(Number minimum) { + public @Nullable Number minimum = null; + public JsonSchemaInfo minimum(@NonNull Number minimum) { this.minimum = minimum; return this; } - public BigDecimal multipleOf; - public JsonSchemaInfo multipleOf(BigDecimal multipleOf) { + public @Nullable BigDecimal multipleOf = null; + public JsonSchemaInfo multipleOf(@NonNull BigDecimal multipleOf) { this.multipleOf = multipleOf; return this; } - public Class additionalProperties; - public JsonSchemaInfo additionalProperties(Class additionalProperties) { + public @Nullable Class additionalProperties; + public JsonSchemaInfo additionalProperties(@NonNull Class additionalProperties) { this.additionalProperties = additionalProperties; return this; } - public List> allOf; - public JsonSchemaInfo allOf(List> allOf) { + public @Nullable List> allOf = null; + public JsonSchemaInfo allOf(@NonNull List> allOf) { this.allOf = allOf; return this; } - public List> anyOf; - public JsonSchemaInfo anyOf(List> anyOf) { + public @Nullable List> anyOf = null; + public JsonSchemaInfo anyOf(@NonNull List> anyOf) { this.anyOf = anyOf; return this; } - public List> oneOf; - public JsonSchemaInfo oneOf(List> oneOf) { + public @Nullable List> oneOf = null; + public JsonSchemaInfo oneOf(@NonNull List> oneOf) { this.oneOf = oneOf; return this; } - public Class not; - public JsonSchemaInfo not(Class not) { + public @Nullable Class not = null; + public JsonSchemaInfo not(@NonNull Class not) { this.not = not; return this; } - public Boolean uniqueItems; - public JsonSchemaInfo uniqueItems(Boolean uniqueItems) { + public @Nullable Boolean uniqueItems = null; + public JsonSchemaInfo uniqueItems(@NonNull Boolean uniqueItems) { this.uniqueItems = uniqueItems; return this; } - public Set enumValues; - public JsonSchemaInfo enumValues(Set enumValues) { + public @Nullable Set enumValues = null; + public JsonSchemaInfo enumValues(@NonNull Set enumValues) { this.enumValues = enumValues; return this; } - public Pattern pattern; - public JsonSchemaInfo pattern(Pattern pattern) { + public @Nullable Pattern pattern = null; + public JsonSchemaInfo pattern(@NonNull Pattern pattern) { this.pattern = pattern; return this; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs index 121cff1d68d..793be54ca4a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs @@ -4,6 +4,8 @@ import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; import {{{packageName}}}.configurations.SchemaConfiguration; import {{{packageName}}}.exceptions.InvalidTypeException; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; import java.time.ZonedDateTime; @@ -18,7 +20,7 @@ import java.util.Objects; import java.util.UUID; public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { - private static UnsetAnyTypeJsonSchema instance; + private static @Nullable UnsetAnyTypeJsonSchema instance = null; protected UnsetAnyTypeJsonSchema() { super(new JsonSchemaInfo()); From 1be0dccf64dd4284fc9a2ffcfda6d66949f519da Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 18 Dec 2023 15:26:45 -0800 Subject: [PATCH 02/52] Adds missing compilerArgs for the checker framework --- samples/client/3_0_3_unit_test/java/pom.xml | 16 +++++++++++++--- src/main/resources/java/pom.hbs | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/pom.xml b/samples/client/3_0_3_unit_test/java/pom.xml index c5d5385147d..4d8f0f3047b 100644 --- a/samples/client/3_0_3_unit_test/java/pom.xml +++ b/samples/client/3_0_3_unit_test/java/pom.xml @@ -43,9 +43,19 @@ true 128m 512m - - -Xlint:all + -Xlint:all + + -Awarns -J-Xss4m + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED @@ -292,7 +302,7 @@ 17 UTF-8 1.6.3 - 3.42.0 + 3.35.0 1.19.4 2.12.6 2.12.6.1 diff --git a/src/main/resources/java/pom.hbs b/src/main/resources/java/pom.hbs index 26e0d42e7d5..449e4506517 100644 --- a/src/main/resources/java/pom.hbs +++ b/src/main/resources/java/pom.hbs @@ -50,9 +50,19 @@ true 128m 512m - - -Xlint:all + -Xlint:all + + -Awarns -J-Xss4m + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED From a96c7a18a894b73e8e8f8093c8d534893dedb963 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 00:21:58 -0800 Subject: [PATCH 03/52] Adds some needed annotations --- samples/client/3_0_3_unit_test/java/pom.xml | 2 +- .../client/schemas/validation/JsonSchema.java | 40 +++++++++---------- .../schemas/validation/TypeValidator.java | 3 +- .../validation/ValidationMetadata.java | 6 ++- src/main/resources/java/pom.hbs | 2 +- .../schemas/validation/JsonSchema.hbs | 40 +++++++++---------- .../schemas/validation/ValidationMetadata.hbs | 6 ++- 7 files changed, 52 insertions(+), 47 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/pom.xml b/samples/client/3_0_3_unit_test/java/pom.xml index 4d8f0f3047b..de3b2c6c85e 100644 --- a/samples/client/3_0_3_unit_test/java/pom.xml +++ b/samples/client/3_0_3_unit_test/java/pom.xml @@ -302,7 +302,7 @@ 17 UTF-8 1.6.3 - 3.35.0 + 3.34.0 1.19.4 2.12.6 2.12.6.1 diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 46a10c6217a..2307d2c5a91 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -217,7 +217,7 @@ protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { this.keywordToValidator = keywordToValidator; } - public abstract Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas); + public abstract Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas); public static PathToSchemasMap validate( JsonSchema jsonSchema, @@ -227,30 +227,30 @@ public static PathToSchemasMap validate( LinkedHashSet disabledKeywords = validationMetadata.configuration().disabledKeywordFlags().getKeywords(); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); LinkedHashMap thisKeywordToValidator = jsonSchema.keywordToValidator; - if (thisKeywordToValidator != null) { - for (Map.Entry entry: thisKeywordToValidator.entrySet()) { - String jsonKeyword = entry.getKey(); - if (disabledKeywords.contains(jsonKeyword)) { - continue; - } - KeywordValidator validator = entry.getValue(); - PathToSchemasMap otherPathToSchemas = validator.validate( - jsonSchema, - arg, - validationMetadata - ); - if (otherPathToSchemas == null) { - continue; - } - pathToSchemas.update(otherPathToSchemas); + for (Map.Entry entry: thisKeywordToValidator.entrySet()) { + String jsonKeyword = entry.getKey(); + if (disabledKeywords.contains(jsonKeyword)) { + continue; } + KeywordValidator validator = entry.getValue(); + PathToSchemasMap otherPathToSchemas = validator.validate( + jsonSchema, + arg, + validationMetadata + ); + if (otherPathToSchemas == null) { + continue; + } + pathToSchemas.update(otherPathToSchemas); } List pathToItem = validationMetadata.pathToItem(); if (!pathToSchemas.containsKey(pathToItem)) { pathToSchemas.put(validationMetadata.pathToItem(), new LinkedHashMap<>()); } - pathToSchemas.get(pathToItem).put(jsonSchema, null); - + @Nullable LinkedHashMap schemas = pathToSchemas.get(pathToItem); + if (schemas != null) { + schemas.put(jsonSchema, null); + } return pathToSchemas; } @@ -350,7 +350,7 @@ public String getNewInstance(String arg, List pathToItem, PathToSchemasM return arg; } - protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, Object arg, ValidationMetadata validationMetadata, Set> pathSet) { + protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata, Set> pathSet) { PathToSchemasMap pathToSchemasMap = new PathToSchemasMap(); // todo add check of validationMetadata.validationRanEarlier(this) PathToSchemasMap otherPathToSchemas = validate(jsonSchema, arg, validationMetadata); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java index 33d23b656fa..e9c1ff8504f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.NonNull; import org.openapijsonschematools.client.exceptions.ValidationException; import java.util.List; @@ -7,7 +8,7 @@ import java.util.Set; public class TypeValidator implements KeywordValidator { - public final Set> type; + public final @NonNull Set> type; public TypeValidator(Set> type) { this.type = type; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java index 3e8cd38b234..c23b81920eb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java @@ -1,5 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import java.util.List; import java.util.Map; @@ -8,12 +10,12 @@ public record ValidationMetadata( List pathToItem, SchemaConfiguration configuration, - PathToSchemasMap validatedPathToSchemas, + @NonNull PathToSchemasMap validatedPathToSchemas, Set> seenClasses ) { public boolean validationRanEarlier(JsonSchema schema) { - Map validatedSchemas = validatedPathToSchemas.getOrDefault(pathToItem, null); + @Nullable Map validatedSchemas = validatedPathToSchemas.get(pathToItem); if (validatedSchemas != null && validatedSchemas.containsKey(schema)) { return true; } diff --git a/src/main/resources/java/pom.hbs b/src/main/resources/java/pom.hbs index 449e4506517..c751b7ad6d9 100644 --- a/src/main/resources/java/pom.hbs +++ b/src/main/resources/java/pom.hbs @@ -342,7 +342,7 @@ 17 UTF-8 1.6.3 - 3.35.0 + 3.34.0 1.19.4 2.12.6 2.12.6.1 diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index e38ff5129cf..8c20fbcc057 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -217,7 +217,7 @@ public abstract class JsonSchema { this.keywordToValidator = keywordToValidator; } - public abstract Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas); + public abstract Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas); public static PathToSchemasMap validate( JsonSchema jsonSchema, @@ -227,30 +227,30 @@ public abstract class JsonSchema { LinkedHashSet disabledKeywords = validationMetadata.configuration().disabledKeywordFlags().getKeywords(); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); LinkedHashMap thisKeywordToValidator = jsonSchema.keywordToValidator; - if (thisKeywordToValidator != null) { - for (Map.Entry entry: thisKeywordToValidator.entrySet()) { - String jsonKeyword = entry.getKey(); - if (disabledKeywords.contains(jsonKeyword)) { - continue; - } - KeywordValidator validator = entry.getValue(); - PathToSchemasMap otherPathToSchemas = validator.validate( - jsonSchema, - arg, - validationMetadata - ); - if (otherPathToSchemas == null) { - continue; - } - pathToSchemas.update(otherPathToSchemas); + for (Map.Entry entry: thisKeywordToValidator.entrySet()) { + String jsonKeyword = entry.getKey(); + if (disabledKeywords.contains(jsonKeyword)) { + continue; } + KeywordValidator validator = entry.getValue(); + PathToSchemasMap otherPathToSchemas = validator.validate( + jsonSchema, + arg, + validationMetadata + ); + if (otherPathToSchemas == null) { + continue; + } + pathToSchemas.update(otherPathToSchemas); } List pathToItem = validationMetadata.pathToItem(); if (!pathToSchemas.containsKey(pathToItem)) { pathToSchemas.put(validationMetadata.pathToItem(), new LinkedHashMap<>()); } - pathToSchemas.get(pathToItem).put(jsonSchema, null); - + @Nullable LinkedHashMap schemas = pathToSchemas.get(pathToItem); + if (schemas != null) { + schemas.put(jsonSchema, null); + } return pathToSchemas; } @@ -350,7 +350,7 @@ public abstract class JsonSchema { return arg; } - protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, Object arg, ValidationMetadata validationMetadata, Set> pathSet) { + protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata, Set> pathSet) { PathToSchemasMap pathToSchemasMap = new PathToSchemasMap(); // todo add check of validationMetadata.validationRanEarlier(this) PathToSchemasMap otherPathToSchemas = validate(jsonSchema, arg, validationMetadata); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs index 56175bb8976..77f90700785 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs @@ -1,5 +1,7 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import {{{packageName}}}.configurations.SchemaConfiguration; import java.util.List; import java.util.Map; @@ -8,12 +10,12 @@ import java.util.Set; public record ValidationMetadata( List pathToItem, SchemaConfiguration configuration, - PathToSchemasMap validatedPathToSchemas, + @NonNull PathToSchemasMap validatedPathToSchemas, Set> seenClasses ) { public boolean validationRanEarlier(JsonSchema schema) { - Map validatedSchemas = validatedPathToSchemas.getOrDefault(pathToItem, null); + @Nullable Map validatedSchemas = validatedPathToSchemas.get(pathToItem); if (validatedSchemas != null && validatedSchemas.containsKey(schema)) { return true; } From 169ac9d245967ddbbdc6f6e2aeb8192ae4bab6d6 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 00:29:40 -0800 Subject: [PATCH 04/52] Adds nullable annotation to getNewInstance object input --- ...rtiesAllowsASchemaWhichShouldValidate.java | 2 +- ...ditionalpropertiesAreAllowedByDefault.java | 2 +- .../AdditionalpropertiesCanExistByItself.java | 2 +- ...lpropertiesShouldNotLookInApplicators.java | 4 +-- .../client/components/schemas/Allof.java | 6 ++-- .../schemas/AllofCombinedWithAnyofOneof.java | 8 ++--- .../components/schemas/AllofSimpleTypes.java | 6 ++-- .../schemas/AllofWithBaseSchema.java | 6 ++-- .../schemas/AllofWithOneEmptySchema.java | 2 +- .../schemas/AllofWithTheFirstEmptySchema.java | 2 +- .../schemas/AllofWithTheLastEmptySchema.java | 2 +- .../schemas/AllofWithTwoEmptySchemas.java | 2 +- .../client/components/schemas/Anyof.java | 4 +-- .../components/schemas/AnyofComplexTypes.java | 6 ++-- .../schemas/AnyofWithBaseSchema.java | 6 ++-- .../schemas/AnyofWithOneEmptySchema.java | 2 +- .../schemas/ArrayTypeMatchesArrays.java | 2 +- .../client/components/schemas/ByInt.java | 2 +- .../client/components/schemas/ByNumber.java | 2 +- .../components/schemas/BySmallNumber.java | 2 +- .../components/schemas/DateTimeFormat.java | 2 +- .../components/schemas/EmailFormat.java | 2 +- .../schemas/EnumWith0DoesNotMatchFalse.java | 2 +- .../schemas/EnumWith1DoesNotMatchTrue.java | 2 +- .../schemas/EnumWithEscapedCharacters.java | 2 +- .../schemas/EnumWithFalseDoesNotMatch0.java | 2 +- .../schemas/EnumWithTrueDoesNotMatch1.java | 2 +- .../components/schemas/EnumsInProperties.java | 6 ++-- .../components/schemas/ForbiddenProperty.java | 2 +- .../components/schemas/HostnameFormat.java | 2 +- ...ouldNotRaiseErrorWhenFloatDivisionInf.java | 2 +- .../schemas/InvalidStringValueForDefault.java | 4 +-- .../client/components/schemas/Ipv4Format.java | 2 +- .../client/components/schemas/Ipv6Format.java | 2 +- .../components/schemas/JsonPointerFormat.java | 2 +- .../components/schemas/MaximumValidation.java | 2 +- .../MaximumValidationWithUnsignedInteger.java | 2 +- .../schemas/MaxitemsValidation.java | 2 +- .../schemas/MaxlengthValidation.java | 2 +- .../Maxproperties0MeansTheObjectIsEmpty.java | 2 +- .../schemas/MaxpropertiesValidation.java | 2 +- .../components/schemas/MinimumValidation.java | 2 +- .../MinimumValidationWithSignedInteger.java | 2 +- .../schemas/MinitemsValidation.java | 2 +- .../schemas/MinlengthValidation.java | 2 +- .../schemas/MinpropertiesValidation.java | 2 +- ...NestedAllofToCheckValidationSemantics.java | 4 +-- ...NestedAnyofToCheckValidationSemantics.java | 4 +-- .../components/schemas/NestedItems.java | 8 ++--- ...NestedOneofToCheckValidationSemantics.java | 4 +-- .../client/components/schemas/Not.java | 2 +- .../schemas/NotMoreComplexSchema.java | 4 +-- .../schemas/NulCharactersInStrings.java | 2 +- .../schemas/ObjectPropertiesValidation.java | 2 +- .../client/components/schemas/Oneof.java | 4 +-- .../components/schemas/OneofComplexTypes.java | 6 ++-- .../schemas/OneofWithBaseSchema.java | 6 ++-- .../schemas/OneofWithEmptySchema.java | 2 +- .../components/schemas/OneofWithRequired.java | 6 ++-- .../schemas/PatternIsNotAnchored.java | 2 +- .../components/schemas/PatternValidation.java | 2 +- .../PropertiesWithEscapedCharacters.java | 2 +- .../PropertyNamedRefThatIsNotAReference.java | 2 +- .../schemas/RefInAdditionalproperties.java | 2 +- .../client/components/schemas/RefInAllof.java | 2 +- .../client/components/schemas/RefInAnyof.java | 2 +- .../client/components/schemas/RefInItems.java | 2 +- .../client/components/schemas/RefInNot.java | 2 +- .../client/components/schemas/RefInOneof.java | 2 +- .../components/schemas/RefInProperty.java | 2 +- .../schemas/RequiredDefaultValidation.java | 2 +- .../schemas/RequiredValidation.java | 2 +- .../schemas/RequiredWithEmptyArray.java | 2 +- .../RequiredWithEscapedCharacters.java | 2 +- .../schemas/SimpleEnumValidation.java | 2 +- ...esNotDoAnythingIfThePropertyIsMissing.java | 4 +-- .../schemas/UniqueitemsFalseValidation.java | 2 +- .../schemas/UniqueitemsValidation.java | 2 +- .../client/components/schemas/UriFormat.java | 2 +- .../schemas/UriReferenceFormat.java | 2 +- .../components/schemas/UriTemplateFormat.java | 2 +- .../client/schemas/AnyTypeJsonSchema.java | 2 +- .../client/schemas/BooleanJsonSchema.java | 2 +- .../client/schemas/DateJsonSchema.java | 2 +- .../client/schemas/DateTimeJsonSchema.java | 2 +- .../client/schemas/DecimalJsonSchema.java | 2 +- .../client/schemas/DoubleJsonSchema.java | 2 +- .../client/schemas/FloatJsonSchema.java | 2 +- .../client/schemas/Int32JsonSchema.java | 2 +- .../client/schemas/Int64JsonSchema.java | 2 +- .../client/schemas/IntJsonSchema.java | 2 +- .../client/schemas/ListJsonSchema.java | 2 +- .../client/schemas/MapJsonSchema.java | 2 +- .../client/schemas/NotAnyTypeJsonSchema.java | 2 +- .../client/schemas/NullJsonSchema.java | 2 +- .../client/schemas/NumberJsonSchema.java | 2 +- .../client/schemas/StringJsonSchema.java | 2 +- .../client/schemas/UuidJsonSchema.java | 2 +- .../client/schemas/validation/JsonSchema.java | 32 +------------------ .../schemas/validation/TypeValidator.java | 3 +- .../validation/UnsetAnyTypeJsonSchema.java | 2 +- .../_getNewInstanceObject_implementor.hbs | 2 +- .../packagename/schemas/AnyTypeJsonSchema.hbs | 2 +- .../packagename/schemas/BooleanJsonSchema.hbs | 2 +- .../packagename/schemas/DateJsonSchema.hbs | 2 +- .../schemas/DateTimeJsonSchema.hbs | 2 +- .../packagename/schemas/DecimalJsonSchema.hbs | 2 +- .../packagename/schemas/DoubleJsonSchema.hbs | 2 +- .../packagename/schemas/FloatJsonSchema.hbs | 2 +- .../packagename/schemas/Int32JsonSchema.hbs | 2 +- .../packagename/schemas/Int64JsonSchema.hbs | 2 +- .../packagename/schemas/IntJsonSchema.hbs | 2 +- .../packagename/schemas/ListJsonSchema.hbs | 2 +- .../packagename/schemas/MapJsonSchema.hbs | 2 +- .../schemas/NotAnyTypeJsonSchema.hbs | 2 +- .../packagename/schemas/NullJsonSchema.hbs | 2 +- .../packagename/schemas/NumberJsonSchema.hbs | 2 +- .../packagename/schemas/StringJsonSchema.hbs | 2 +- .../packagename/schemas/UuidJsonSchema.hbs | 2 +- .../schemas/validation/JsonSchema.hbs | 32 +------------------ .../validation/UnsetAnyTypeJsonSchema.hbs | 2 +- 121 files changed, 154 insertions(+), 215 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 02dea6dfb92..da56283c304 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -126,7 +126,7 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap validate(Map pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index c53237caaf2..bb52788eac7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -239,7 +239,7 @@ public AdditionalpropertiesAreAllowedByDefaultMap validate(Map a } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index f271300a667..7f1d3d24bfe 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -99,7 +99,7 @@ public AdditionalpropertiesCanExistByItselfMap validate(Map arg @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index 602b37afd18..81792e9a81b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -226,7 +226,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -427,7 +427,7 @@ public AdditionalpropertiesShouldNotLookInApplicatorsMap validate(Map pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index b965cf3cb48..7b3dd88d8c9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -224,7 +224,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -431,7 +431,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -612,7 +612,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index bb72d210e85..bd07178eadd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -187,7 +187,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -359,7 +359,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -531,7 +531,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -717,7 +717,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index 78a90f4526c..f36e0ee0fba 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -186,7 +186,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -358,7 +358,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -539,7 +539,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 07947ea4675..cee7df7c0ea 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -225,7 +225,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -432,7 +432,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -649,7 +649,7 @@ public AllofWithBaseSchemaMap validate(Map arg, SchemaConfigurat } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index 733513de5dd..fdc4205ae3c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -198,7 +198,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 8ca1a0d6999..71a03b98132 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -203,7 +203,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index cf57dec0d9f..b472d540e19 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -203,7 +203,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index 7e89f52acf7..ead71719a8e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -202,7 +202,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index e8a7d1de08a..e4eeadf63dc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -190,7 +190,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -371,7 +371,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 34154803d37..385f93343e8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -224,7 +224,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -431,7 +431,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -612,7 +612,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index b385d4b00f2..b7ea966d2d6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -186,7 +186,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -358,7 +358,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -417,7 +417,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index 344e63e76bd..58990990315 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -203,7 +203,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java index 4278313b529..252936fde78 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java @@ -93,7 +93,7 @@ public ArrayTypeMatchesArraysList validate(List arg, SchemaConfiguration } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 90ef089599a..9b4acd8479d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -193,7 +193,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 5335882b4eb..c772b1b554b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -193,7 +193,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index df9a2966cfb..b6b215b3d0b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -193,7 +193,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 9cde3f8262c..e1b15ee0e05 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index 76e6c160842..8c6d7de05ca 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java index 829598dc550..3bd9dd58897 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java @@ -81,7 +81,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java index 5169a41d8f1..ee5bff73b89 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java @@ -81,7 +81,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java index d24ed4f9165..9f3dde3b9e3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java @@ -64,7 +64,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java index f6e31e42379..8e07243ab08 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java @@ -61,7 +61,7 @@ public boolean validate(boolean arg, SchemaConfiguration configuration) throws V } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Boolean) { boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java index ee7079dc85c..b34c87103fb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java @@ -61,7 +61,7 @@ public boolean validate(boolean arg, SchemaConfiguration configuration) throws V } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Boolean) { boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index 071668a5f42..2d245f530b5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -60,7 +60,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } @@ -101,7 +101,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } @@ -201,7 +201,7 @@ public EnumsInPropertiesMap validate(Map arg, SchemaConfiguratio @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 773f51292c4..2072b6bbfbe 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -230,7 +230,7 @@ public ForbiddenPropertyMap validate(Map arg, SchemaConfiguratio } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index aa80c2d11a9..5a2dcc164cc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java index 6f878aa6245..f4217dfe1a9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java @@ -80,7 +80,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index f3583c4527a..3ac416e6f00 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -65,7 +65,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } @@ -263,7 +263,7 @@ public InvalidStringValueForDefaultMap validate(Map arg, SchemaC } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index 6de834c3485..4a417fe59e9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index 6234cedbc30..2b18e0e19d8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 8c2024b8c4a..cdb42656ed4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 6b3d5a4ab20..2b81230665d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 04637ec23fe..e3bdac01902 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index d2a46325ad7..d4759c850af 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 2f811e71b43..deaf3e1af1b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index 285a0829140..4e09fd6a06f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index f43e83129e4..cca8e9b981f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index 0584459b588..f45504615a9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index ac8a966bff2..8a9ea8a02d6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index 26e9bfa5385..d903be2868d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 5145f1e135b..c73e9e3affb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index d60955680f5..b5cb52856d9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index a135a84c3ca..401f976bbc9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -372,7 +372,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index 214e8e43c6c..03a00e0edc2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -372,7 +372,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index 1b33f84f11a..2406526ce0c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -87,7 +87,7 @@ public ItemsList validate(List arg, SchemaConfiguration configuration) t } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } @@ -154,7 +154,7 @@ public ItemsList1 validate(List> arg, SchemaConfiguration configura } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } @@ -221,7 +221,7 @@ public ItemsList2 validate(List>> arg, SchemaConfiguration con } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } @@ -294,7 +294,7 @@ public NestedItemsList validate(List>>> arg, SchemaConfig } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index 0c7339edc17..886d71d8f7d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -372,7 +372,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index d0142bcd9fa..26ee0ecd7d2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -196,7 +196,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 0bce346f507..25753d8c955 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -114,7 +114,7 @@ public NotMap validate(Map arg, SchemaConfiguration configuratio @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } @@ -282,7 +282,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java index 926f7a43dea..7e55471a610 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java @@ -63,7 +63,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index a6fd67f7d16..df80742b5e8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -240,7 +240,7 @@ public ObjectPropertiesValidationMap validate(Map arg, SchemaCon } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index 52d2f48e7b9..b436445daac 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -190,7 +190,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -371,7 +371,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index f983bd6f330..cdc45e9d7da 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -224,7 +224,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -431,7 +431,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -612,7 +612,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index d6746733176..77582573ccd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -186,7 +186,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -358,7 +358,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -417,7 +417,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 5b7c724d010..2f42218b746 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -203,7 +203,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index c95bfc5b793..945fa18cd75 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -221,7 +221,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -428,7 +428,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -501,7 +501,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index 7eaf69513a8..9177eddbbc3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -195,7 +195,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index a183713e28e..93030439b38 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -195,7 +195,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 1367ef10bdd..8b528883ac0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -247,7 +247,7 @@ public PropertiesWithEscapedCharactersMap validate(Map arg, Sche } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 2078e50ee0e..7387e36a77a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -222,7 +222,7 @@ public PropertyNamedRefThatIsNotAReferenceMap validate(Map arg, } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 34234d24bd9..3e87ff575cc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -95,7 +95,7 @@ public RefInAdditionalpropertiesMap validate(Map arg, SchemaConf @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index 47a8365ad10..a34b40707e1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -194,7 +194,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index 16a07e07c02..63a6e7feb71 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -194,7 +194,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java index dd5492aa79f..93653b7b0b4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java @@ -89,7 +89,7 @@ public RefInItemsList validate(List arg, SchemaConfiguration configurati } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index bbd5eaa585e..d0e150ebfda 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index 3fc18d2e356..72b57543ab2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -194,7 +194,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index b568933359a..2bd9e6dfc85 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -224,7 +224,7 @@ public RefInPropertyMap validate(Map arg, SchemaConfiguration co } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 3a0e96b58ed..8220f5adbf9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -228,7 +228,7 @@ public RequiredDefaultValidationMap validate(Map arg, SchemaConf } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index aee18fa2fde..413e7fc910d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -241,7 +241,7 @@ public RequiredValidationMap validate(Map arg, SchemaConfigurati } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index 97d388d266b..a1b118cbfbb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -228,7 +228,7 @@ public RequiredWithEmptyArrayMap validate(Map arg, SchemaConfigu } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index 44ce643cf32..bf44be3a31a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -227,7 +227,7 @@ public RequiredWithEscapedCharactersMap validate(Map arg, Schema } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java index 5c14bae387d..d185130c8ac 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java @@ -83,7 +83,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 6e1e61efc35..2d799c456a2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -75,7 +75,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } @@ -165,7 +165,7 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap validate(Map< @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index 408dbc62f15..798b7faa683 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 8d5ba9e580c..f515f1a3f22 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index e1402a5f95e..a18c96c828d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index 3d7a915a9d6..26b13152147 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index b6e941e00e9..14ca8acebf4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index 94994d47ab0..a9efede145d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -182,7 +182,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java index d9cde59919c..13daa6b0848 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java @@ -55,7 +55,7 @@ public boolean validate(boolean arg, SchemaConfiguration configuration) throws V } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Boolean) { boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java index ce83f017101..0a758f7de07 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -59,7 +59,7 @@ public static DateJsonSchema getInstance() { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java index ad30db1e8cb..e97204d7c11 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java @@ -62,7 +62,7 @@ public String validate(ZonedDateTime arg, SchemaConfiguration configuration) thr } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java index b3a61c3249a..13be448b62c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java @@ -57,7 +57,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java index d973116034c..b891bd5db59 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java @@ -61,7 +61,7 @@ public double validate(double arg, SchemaConfiguration configuration) { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java index 5581eda320e..48151e89bfc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java @@ -61,7 +61,7 @@ public float validate(float arg, SchemaConfiguration configuration) { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java index 9be368c67c1..de99f890750 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java @@ -68,7 +68,7 @@ public float validate(float arg, SchemaConfiguration configuration) throws Valid } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java index a6d94c7cecb..42249d7a504 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java @@ -78,7 +78,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java index ec42620c8c2..f125fd84e0e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java @@ -78,7 +78,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java index 22525fb2002..d0d36292c95 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java @@ -65,7 +65,7 @@ public FrozenList validate(List arg, SchemaConfiguration configu } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index dcf00b8fd39..dbe29233d19 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -65,7 +65,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index 9afa456f949..8b870efc8d5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -184,7 +184,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java index 8b1444d2de7..2c9a6717b3b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java @@ -55,7 +55,7 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java index 838db4ea6a0..10c2d6bfd10 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java @@ -76,7 +76,7 @@ public double validate(double arg, SchemaConfiguration configuration) { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java index c49fee64efb..248dc24f814 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java @@ -70,7 +70,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java index bc37c792a0e..c0dfbb79096 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java @@ -62,7 +62,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 2307d2c5a91..84bb6387cc6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -302,7 +302,7 @@ protected List castToAllowedTypes(List arg, List pathToItem, Set pathToItem, Set> pathSet) { + private Object castToAllowedObjectTypes(@Nullable Object arg, List pathToItem, Set> pathSet) { if (arg == null) { return castToAllowedTypes((Void) null, pathToItem, pathSet); } else if (arg instanceof String) { @@ -371,35 +371,5 @@ protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nulla return pathToSchemasMap; } - /* - protected FrozenMap getProperties(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - String propertyName = entry.getKey(); - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - MapValueCastType value = entry.getValue(); - JsonSchema propertySchema = (JsonSchema) pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - MapValueOutType castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); - } - return new FrozenMap<>(properties); - } - - private FrozenList getItems(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - ArrayList items = new ArrayList<>(); - int i = 0; - for (ListItemCastType item: arg) { - List itemPathToItem = new ArrayList<>(pathToItem); - itemPathToItem.add(i); - JsonSchema itemSchema = (JsonSchema) pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - ListItemOutType castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); - i += 1; - } - return new FrozenList<>(items); - } - */ - // todo add bytes and FileIO } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java index e9c1ff8504f..33d23b656fa 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java @@ -1,6 +1,5 @@ package org.openapijsonschematools.client.schemas.validation; -import org.checkerframework.checker.nullness.qual.NonNull; import org.openapijsonschematools.client.exceptions.ValidationException; import java.util.List; @@ -8,7 +7,7 @@ import java.util.Set; public class TypeValidator implements KeywordValidator { - public final @NonNull Set> type; + public final Set> type; public TypeValidator(Set> type) { this.type = type; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index 0b8acd75d9f..6de7b929d7c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -170,7 +170,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs index c4a86c51f5c..4c9d396bf9d 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs @@ -1,6 +1,6 @@ @Override -public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { +public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { {{#if types}} {{#each types}} {{#if @first}} diff --git a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs index 362934004ae..923c995b51e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs @@ -182,7 +182,7 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs index b03b01fab3d..5672fd5c20b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs @@ -55,7 +55,7 @@ public class BooleanJsonSchema extends JsonSchema implements BooleanSchemaValida } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Boolean) { boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs index 646ee766871..0a807c6a0db 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs @@ -59,7 +59,7 @@ public class DateJsonSchema extends JsonSchema implements StringSchemaValidator } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs index 577851be601..51bfb5fdef7 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs @@ -62,7 +62,7 @@ public class DateTimeJsonSchema extends JsonSchema implements StringSchemaValida } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs index c1232d15f41..402dce030cc 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs @@ -57,7 +57,7 @@ public class DecimalJsonSchema extends JsonSchema implements StringSchemaValidat } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs index 6c699e13f91..2d65997853d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs @@ -61,7 +61,7 @@ public class DoubleJsonSchema extends JsonSchema implements NumberSchemaValidato } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs index c9637c419e0..b8c3327b0d0 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs @@ -61,7 +61,7 @@ public class FloatJsonSchema extends JsonSchema implements NumberSchemaValidator } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs index 027212b2b29..6853d9b808f 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs @@ -68,7 +68,7 @@ public class Int32JsonSchema extends JsonSchema implements NumberSchemaValidator } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs index 3956f35d27b..c6609437b3f 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs @@ -78,7 +78,7 @@ public class Int64JsonSchema extends JsonSchema implements NumberSchemaValidator } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs index fbe560b484b..98ece50ef30 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs @@ -78,7 +78,7 @@ public class IntJsonSchema extends JsonSchema implements NumberSchemaValidator { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs index 18c51374300..1ddde0cc8c7 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs @@ -65,7 +65,7 @@ public class ListJsonSchema extends JsonSchema implements ListSchemaValidator pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs index 001fbc807e9..143796bc11d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs @@ -65,7 +65,7 @@ public class MapJsonSchema extends JsonSchema implements MapSchemaValidator pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs index 5ca7955332a..ea4a5434988 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs @@ -184,7 +184,7 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs index 97e2312878b..f2edf14741e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs @@ -55,7 +55,7 @@ public class NullJsonSchema extends JsonSchema implements NullSchemaValidator { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs index 83d453bad11..c32d5fcc71d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs @@ -76,7 +76,7 @@ public class NumberJsonSchema extends JsonSchema implements NumberSchemaValidato } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs index 5b2449975ef..772ae86a1f7 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs @@ -70,7 +70,7 @@ public class StringJsonSchema extends JsonSchema implements StringSchemaValidato } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs index 65838956e6b..8b61de8895a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs @@ -62,7 +62,7 @@ public class UuidJsonSchema extends JsonSchema implements StringSchemaValidator } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index 8c20fbcc057..269cfe90f66 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -302,7 +302,7 @@ public abstract class JsonSchema { return argFixed; } - protected Object castToAllowedObjectTypes(Object arg, List pathToItem, Set> pathSet) { + private Object castToAllowedObjectTypes(@Nullable Object arg, List pathToItem, Set> pathSet) { if (arg == null) { return castToAllowedTypes((Void) null, pathToItem, pathSet); } else if (arg instanceof String) { @@ -371,35 +371,5 @@ public abstract class JsonSchema { return pathToSchemasMap; } - /* - protected FrozenMap getProperties(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - String propertyName = entry.getKey(); - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - MapValueCastType value = entry.getValue(); - JsonSchema propertySchema = (JsonSchema) pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - MapValueOutType castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); - } - return new FrozenMap<>(properties); - } - - private FrozenList getItems(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - ArrayList items = new ArrayList<>(); - int i = 0; - for (ListItemCastType item: arg) { - List itemPathToItem = new ArrayList<>(pathToItem); - itemPathToItem.add(i); - JsonSchema itemSchema = (JsonSchema) pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - ListItemOutType castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); - i += 1; - } - return new FrozenList<>(items); - } - */ - // todo add bytes and FileIO } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs index 793be54ca4a..0814f3491f8 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs @@ -170,7 +170,7 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { From 318db0d4d774b3e88182acee5569291e5e758d8a Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 11:26:23 -0800 Subject: [PATCH 05/52] Adds and uses getClass method to protect against getting the class of the value null --- ...tionalpropertiesAllowsASchemaWhichShouldValidate.java | 2 +- .../schemas/AdditionalpropertiesAreAllowedByDefault.java | 2 +- .../schemas/AdditionalpropertiesCanExistByItself.java | 2 +- .../AdditionalpropertiesShouldNotLookInApplicators.java | 4 ++-- .../client/components/schemas/Allof.java | 6 +++--- .../components/schemas/AllofCombinedWithAnyofOneof.java | 8 ++++---- .../client/components/schemas/AllofSimpleTypes.java | 6 +++--- .../client/components/schemas/AllofWithBaseSchema.java | 6 +++--- .../components/schemas/AllofWithOneEmptySchema.java | 2 +- .../components/schemas/AllofWithTheFirstEmptySchema.java | 2 +- .../components/schemas/AllofWithTheLastEmptySchema.java | 2 +- .../components/schemas/AllofWithTwoEmptySchemas.java | 2 +- .../client/components/schemas/Anyof.java | 4 ++-- .../client/components/schemas/AnyofComplexTypes.java | 6 +++--- .../client/components/schemas/AnyofWithBaseSchema.java | 6 +++--- .../components/schemas/AnyofWithOneEmptySchema.java | 2 +- .../components/schemas/ArrayTypeMatchesArrays.java | 2 +- .../client/components/schemas/ByInt.java | 2 +- .../client/components/schemas/ByNumber.java | 2 +- .../client/components/schemas/BySmallNumber.java | 2 +- .../client/components/schemas/DateTimeFormat.java | 2 +- .../client/components/schemas/EmailFormat.java | 2 +- .../components/schemas/EnumWith0DoesNotMatchFalse.java | 2 +- .../components/schemas/EnumWith1DoesNotMatchTrue.java | 2 +- .../components/schemas/EnumWithEscapedCharacters.java | 2 +- .../components/schemas/EnumWithFalseDoesNotMatch0.java | 2 +- .../components/schemas/EnumWithTrueDoesNotMatch1.java | 2 +- .../client/components/schemas/EnumsInProperties.java | 6 +++--- .../client/components/schemas/ForbiddenProperty.java | 2 +- .../client/components/schemas/HostnameFormat.java | 2 +- ...dInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java | 2 +- .../components/schemas/InvalidStringValueForDefault.java | 4 ++-- .../client/components/schemas/Ipv4Format.java | 2 +- .../client/components/schemas/Ipv6Format.java | 2 +- .../client/components/schemas/JsonPointerFormat.java | 2 +- .../client/components/schemas/MaximumValidation.java | 2 +- .../schemas/MaximumValidationWithUnsignedInteger.java | 2 +- .../client/components/schemas/MaxitemsValidation.java | 2 +- .../client/components/schemas/MaxlengthValidation.java | 2 +- .../schemas/Maxproperties0MeansTheObjectIsEmpty.java | 2 +- .../components/schemas/MaxpropertiesValidation.java | 2 +- .../client/components/schemas/MinimumValidation.java | 2 +- .../schemas/MinimumValidationWithSignedInteger.java | 2 +- .../client/components/schemas/MinitemsValidation.java | 2 +- .../client/components/schemas/MinlengthValidation.java | 2 +- .../components/schemas/MinpropertiesValidation.java | 2 +- .../schemas/NestedAllofToCheckValidationSemantics.java | 4 ++-- .../schemas/NestedAnyofToCheckValidationSemantics.java | 4 ++-- .../client/components/schemas/NestedItems.java | 8 ++++---- .../schemas/NestedOneofToCheckValidationSemantics.java | 4 ++-- .../client/components/schemas/Not.java | 2 +- .../client/components/schemas/NotMoreComplexSchema.java | 4 ++-- .../components/schemas/NulCharactersInStrings.java | 2 +- .../components/schemas/ObjectPropertiesValidation.java | 2 +- .../client/components/schemas/Oneof.java | 4 ++-- .../client/components/schemas/OneofComplexTypes.java | 6 +++--- .../client/components/schemas/OneofWithBaseSchema.java | 6 +++--- .../client/components/schemas/OneofWithEmptySchema.java | 2 +- .../client/components/schemas/OneofWithRequired.java | 6 +++--- .../client/components/schemas/PatternIsNotAnchored.java | 2 +- .../client/components/schemas/PatternValidation.java | 2 +- .../schemas/PropertiesWithEscapedCharacters.java | 2 +- .../schemas/PropertyNamedRefThatIsNotAReference.java | 2 +- .../components/schemas/RefInAdditionalproperties.java | 2 +- .../client/components/schemas/RefInAllof.java | 2 +- .../client/components/schemas/RefInAnyof.java | 2 +- .../client/components/schemas/RefInItems.java | 2 +- .../client/components/schemas/RefInNot.java | 2 +- .../client/components/schemas/RefInOneof.java | 2 +- .../client/components/schemas/RefInProperty.java | 2 +- .../components/schemas/RequiredDefaultValidation.java | 2 +- .../client/components/schemas/RequiredValidation.java | 2 +- .../components/schemas/RequiredWithEmptyArray.java | 2 +- .../schemas/RequiredWithEscapedCharacters.java | 2 +- .../client/components/schemas/SimpleEnumValidation.java | 2 +- ...ltKeywordDoesNotDoAnythingIfThePropertyIsMissing.java | 4 ++-- .../components/schemas/UniqueitemsFalseValidation.java | 2 +- .../client/components/schemas/UniqueitemsValidation.java | 2 +- .../client/components/schemas/UriFormat.java | 2 +- .../client/components/schemas/UriReferenceFormat.java | 2 +- .../client/components/schemas/UriTemplateFormat.java | 2 +- .../client/schemas/AnyTypeJsonSchema.java | 2 +- .../client/schemas/BooleanJsonSchema.java | 2 +- .../client/schemas/DateJsonSchema.java | 2 +- .../client/schemas/DateTimeJsonSchema.java | 2 +- .../client/schemas/DecimalJsonSchema.java | 2 +- .../client/schemas/DoubleJsonSchema.java | 2 +- .../client/schemas/FloatJsonSchema.java | 2 +- .../client/schemas/Int32JsonSchema.java | 2 +- .../client/schemas/Int64JsonSchema.java | 2 +- .../client/schemas/IntJsonSchema.java | 2 +- .../client/schemas/ListJsonSchema.java | 2 +- .../client/schemas/MapJsonSchema.java | 2 +- .../client/schemas/NotAnyTypeJsonSchema.java | 2 +- .../client/schemas/NullJsonSchema.java | 2 +- .../client/schemas/NumberJsonSchema.java | 2 +- .../client/schemas/StringJsonSchema.java | 2 +- .../client/schemas/UuidJsonSchema.java | 2 +- .../client/schemas/validation/JsonSchema.java | 9 ++++++++- .../schemas/validation/UnsetAnyTypeJsonSchema.java | 2 +- .../SchemaClass/_getNewInstanceObject_implementor.hbs | 2 +- .../main/java/packagename/schemas/AnyTypeJsonSchema.hbs | 2 +- .../main/java/packagename/schemas/BooleanJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/DateJsonSchema.hbs | 2 +- .../main/java/packagename/schemas/DateTimeJsonSchema.hbs | 2 +- .../main/java/packagename/schemas/DecimalJsonSchema.hbs | 2 +- .../main/java/packagename/schemas/DoubleJsonSchema.hbs | 2 +- .../main/java/packagename/schemas/FloatJsonSchema.hbs | 2 +- .../main/java/packagename/schemas/Int32JsonSchema.hbs | 2 +- .../main/java/packagename/schemas/Int64JsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/IntJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/ListJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/MapJsonSchema.hbs | 2 +- .../java/packagename/schemas/NotAnyTypeJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/NullJsonSchema.hbs | 2 +- .../main/java/packagename/schemas/NumberJsonSchema.hbs | 2 +- .../main/java/packagename/schemas/StringJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/UuidJsonSchema.hbs | 2 +- .../java/packagename/schemas/validation/JsonSchema.hbs | 9 ++++++++- .../schemas/validation/UnsetAnyTypeJsonSchema.hbs | 2 +- 120 files changed, 167 insertions(+), 153 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index da56283c304..80ba0c510d3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -130,7 +130,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index bb52788eac7..53f9b81745c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -254,7 +254,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index 7f1d3d24bfe..fcb0ef7f68b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -103,7 +103,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index 81792e9a81b..d3e231759ea 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -241,7 +241,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -442,7 +442,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 7b3dd88d8c9..3c39440f721 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -239,7 +239,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -446,7 +446,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -627,7 +627,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index bd07178eadd..347a68cd3ec 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -202,7 +202,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -374,7 +374,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -546,7 +546,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -732,7 +732,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index f36e0ee0fba..9151cb850ba 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -201,7 +201,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -373,7 +373,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -554,7 +554,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index cee7df7c0ea..bedb4808c11 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -240,7 +240,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -447,7 +447,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -664,7 +664,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index fdc4205ae3c..2d1e423ea11 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -213,7 +213,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 71a03b98132..3ef1bcba9d1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -218,7 +218,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index b472d540e19..cd2ac25bf01 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -218,7 +218,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index ead71719a8e..81e01bcbf8c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -217,7 +217,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index e4eeadf63dc..ccd844c7106 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -205,7 +205,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -386,7 +386,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 385f93343e8..95cc2cd4448 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -239,7 +239,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -446,7 +446,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -627,7 +627,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index b7ea966d2d6..5742fa500ab 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -201,7 +201,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -373,7 +373,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -421,7 +421,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index 58990990315..d0d69b48482 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -218,7 +218,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java index 252936fde78..3625ffc50ba 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java @@ -97,7 +97,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 9b4acd8479d..33b5ee41d54 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -208,7 +208,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index c772b1b554b..2b358c4e896 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -208,7 +208,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index b6b215b3d0b..8fa41798ac7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -208,7 +208,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index e1b15ee0e05..54d5963b527 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index 8c6d7de05ca..f3fea3e8c59 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java index 3bd9dd58897..8e066fd2a7c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java @@ -85,7 +85,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java index ee5bff73b89..ac3f803a47b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java @@ -85,7 +85,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java index 9f3dde3b9e3..cab5d40d4eb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java @@ -68,7 +68,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java index 8e07243ab08..5bcc9cd18be 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java @@ -66,7 +66,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java index b34c87103fb..09ec1f87083 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java @@ -66,7 +66,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index 2d245f530b5..c9e01b5b2b9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -64,7 +64,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -105,7 +105,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -205,7 +205,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 2072b6bbfbe..942866d98e3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -245,7 +245,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 5a2dcc164cc..0f47b23645e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java index f4217dfe1a9..080d7ec0b22 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java @@ -84,7 +84,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 3ac416e6f00..595710e517b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -69,7 +69,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -278,7 +278,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index 4a417fe59e9..89d4b535fc1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index 2b18e0e19d8..734ada2463e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index cdb42656ed4..9a8b128a9a9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 2b81230665d..1e51d18b6e1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index e3bdac01902..52e0467fa11 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index d4759c850af..b4448653d98 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index deaf3e1af1b..cb225d0531b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index 4e09fd6a06f..af0f9dc28a2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index cca8e9b981f..9c9e7241e69 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index f45504615a9..ab2b3eb85d0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index 8a9ea8a02d6..ac8a0bbb111 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index d903be2868d..06c13c7ef6a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index c73e9e3affb..13efee53a2a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index b5cb52856d9..cacfeedeb4f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 401f976bbc9..1d3708dbc75 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -387,7 +387,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index 03a00e0edc2..8ea3cb09407 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -387,7 +387,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index 2406526ce0c..5db25c41be8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -91,7 +91,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -158,7 +158,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -225,7 +225,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -298,7 +298,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index 886d71d8f7d..c048632decb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -387,7 +387,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index 26ee0ecd7d2..623d8006ace 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -211,7 +211,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 25753d8c955..ccf4753fbe8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -118,7 +118,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -297,7 +297,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java index 7e55471a610..bfc8168a7db 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java @@ -67,7 +67,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index df80742b5e8..f489bfeb4e9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -255,7 +255,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index b436445daac..20b63261434 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -205,7 +205,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -386,7 +386,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index cdc45e9d7da..2f84f4d062c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -239,7 +239,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -446,7 +446,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -627,7 +627,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index 77582573ccd..50d77f8c401 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -201,7 +201,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -373,7 +373,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -421,7 +421,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 2f42218b746..ae9c5fcc0e3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -218,7 +218,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 945fa18cd75..83707c7dbdb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -236,7 +236,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -443,7 +443,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -505,7 +505,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index 9177eddbbc3..9b3b9a09fe5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -210,7 +210,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index 93030439b38..c13e9ccb6f4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -210,7 +210,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 8b528883ac0..6986a3b7f13 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -262,7 +262,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 7387e36a77a..20a31a4c812 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -237,7 +237,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 3e87ff575cc..3b1dbe02083 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -99,7 +99,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index a34b40707e1..d04e3883c02 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -209,7 +209,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index 63a6e7feb71..da083a33fd4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -209,7 +209,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java index 93653b7b0b4..5df588dbb4a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java @@ -93,7 +93,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index d0e150ebfda..a89ca9d64c2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index 72b57543ab2..9a6c60751fd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -209,7 +209,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index 2bd9e6dfc85..2cbdf938ec6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -239,7 +239,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 8220f5adbf9..49595beea96 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -243,7 +243,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index 413e7fc910d..da6636927a1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -256,7 +256,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index a1b118cbfbb..87449c5b664 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -243,7 +243,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index bf44be3a31a..39587db3ed8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -242,7 +242,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java index d185130c8ac..e9194b3388e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java @@ -87,7 +87,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 2d799c456a2..e618ba8975d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -79,7 +79,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -169,7 +169,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index 798b7faa683..730ade0368f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index f515f1a3f22..0253ef8cb36 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index a18c96c828d..2fcf9afdb5f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index 26b13152147..86d57cde464 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index 14ca8acebf4..48e67c78497 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -207,7 +207,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index a9efede145d..614c5867f94 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -197,6 +197,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java index 13daa6b0848..9b485af2bf8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java @@ -60,6 +60,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java index 0a758f7de07..399b3400a4b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -63,6 +63,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java index e97204d7c11..1a9d3bcd462 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java @@ -66,6 +66,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java index 13be448b62c..8e9b6726281 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java @@ -61,6 +61,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java index b891bd5db59..d86477abd29 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java @@ -65,6 +65,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java index 48151e89bfc..98d11714178 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java @@ -65,6 +65,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java index de99f890750..b30a195b1f3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java @@ -72,6 +72,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java index 42249d7a504..d200b662449 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java @@ -82,6 +82,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java index f125fd84e0e..7d06f3b8c7e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java @@ -82,6 +82,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java index d0d36292c95..4acfec0c5d2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java @@ -69,6 +69,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index dbe29233d19..2d8281f3a17 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -69,6 +69,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof FrozenMap) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index 8b870efc8d5..64050392ab2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -199,6 +199,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java index 2c9a6717b3b..0608e165e74 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java @@ -59,7 +59,7 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java index 10c2d6bfd10..baad71eef6a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java @@ -80,6 +80,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java index 248dc24f814..c351ee8ea44 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java @@ -74,6 +74,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java index c0dfbb79096..6881e4149f0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java @@ -66,6 +66,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 84bb6387cc6..6c095c6d111 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -371,5 +371,12 @@ protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nulla return pathToSchemasMap; } - // todo add bytes and FileIO + public static String getClass(@Nullable Object arg) { + if (arg == null) { + return Void.class.getSimpleName(); + } else { + return arg.getClass().getSimpleName(); + } + } + // todo add bytes and FileIO } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index 6de7b929d7c..3e61f7713e6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -185,6 +185,6 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs index 4c9d396bf9d..cdfef4ba453 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs @@ -47,5 +47,5 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path return getNewInstance((Map) arg, pathToItem, pathToSchemas); } {{/if}} - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs index 923c995b51e..2e4ee342019 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs @@ -197,6 +197,6 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs index 5672fd5c20b..d48f304bef0 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs @@ -60,6 +60,6 @@ public class BooleanJsonSchema extends JsonSchema implements BooleanSchemaValida boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs index 0a807c6a0db..dbc4bbb14af 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs @@ -63,6 +63,6 @@ public class DateJsonSchema extends JsonSchema implements StringSchemaValidator if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs index 51bfb5fdef7..6e98002a69a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs @@ -66,6 +66,6 @@ public class DateTimeJsonSchema extends JsonSchema implements StringSchemaValida if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs index 402dce030cc..be3260f991c 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs @@ -61,6 +61,6 @@ public class DecimalJsonSchema extends JsonSchema implements StringSchemaValidat if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs index 2d65997853d..0c8f4dbb684 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs @@ -65,6 +65,6 @@ public class DoubleJsonSchema extends JsonSchema implements NumberSchemaValidato if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs index b8c3327b0d0..70cfcb74311 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs @@ -65,6 +65,6 @@ public class FloatJsonSchema extends JsonSchema implements NumberSchemaValidator if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs index 6853d9b808f..2f5c3b30595 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs @@ -72,6 +72,6 @@ public class Int32JsonSchema extends JsonSchema implements NumberSchemaValidator if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs index c6609437b3f..884afb5c3ab 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs @@ -82,6 +82,6 @@ public class Int64JsonSchema extends JsonSchema implements NumberSchemaValidator if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs index 98ece50ef30..d56ada48e9e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs @@ -82,6 +82,6 @@ public class IntJsonSchema extends JsonSchema implements NumberSchemaValidator { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs index 1ddde0cc8c7..edd99b9af4a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs @@ -69,6 +69,6 @@ public class ListJsonSchema extends JsonSchema implements ListSchemaValidator) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs index 143796bc11d..6886a2cc686 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs @@ -69,6 +69,6 @@ public class MapJsonSchema extends JsonSchema implements MapSchemaValidator) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs index ea4a5434988..a1ec17a80d1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs @@ -199,6 +199,6 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs index f2edf14741e..6c1d2dd8a6d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs @@ -59,7 +59,7 @@ public class NullJsonSchema extends JsonSchema implements NullSchemaValidator { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs index c32d5fcc71d..5cffc21cea7 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs @@ -80,6 +80,6 @@ public class NumberJsonSchema extends JsonSchema implements NumberSchemaValidato if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs index 772ae86a1f7..a2d6aa75c58 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs @@ -74,6 +74,6 @@ public class StringJsonSchema extends JsonSchema implements StringSchemaValidato if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs index 8b61de8895a..c436f9bb585 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs @@ -66,6 +66,6 @@ public class UuidJsonSchema extends JsonSchema implements StringSchemaValidator if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index 269cfe90f66..80ef2250ab9 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -371,5 +371,12 @@ public abstract class JsonSchema { return pathToSchemasMap; } - // todo add bytes and FileIO + public static String getClass(@Nullable Object arg) { + if (arg == null) { + return Void.class.getSimpleName(); + } else { + return arg.getClass().getSimpleName(); + } + } + // todo add bytes and FileIO } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs index 0814f3491f8..747e8009ee2 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs @@ -185,6 +185,6 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali } else if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } \ No newline at end of file From ad7d117a35ae373c82cf6ac2b0a2f35a4a80c3bc Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 11:56:57 -0800 Subject: [PATCH 06/52] Adds Nullable to arg input of KeywordValidator --- .../validation/AdditionalPropertiesValidator.java | 3 ++- .../client/schemas/validation/AllOfValidator.java | 3 ++- .../client/schemas/validation/AnyOfValidator.java | 3 ++- .../client/schemas/validation/EnumValidator.java | 3 ++- .../validation/ExclusiveMaximumValidator.java | 3 ++- .../validation/ExclusiveMinimumValidator.java | 3 ++- .../client/schemas/validation/FakeValidator.java | 4 +++- .../client/schemas/validation/FormatValidator.java | 3 ++- .../client/schemas/validation/ItemsValidator.java | 4 +++- .../client/schemas/validation/JsonSchema.java | 12 ++++++------ .../client/schemas/validation/KeywordValidator.java | 3 ++- .../client/schemas/validation/MaxItemsValidator.java | 3 ++- .../schemas/validation/MaxLengthValidator.java | 3 ++- .../schemas/validation/MaxPropertiesValidator.java | 3 ++- .../client/schemas/validation/MaximumValidator.java | 3 ++- .../client/schemas/validation/MinItemsValidator.java | 3 ++- .../schemas/validation/MinLengthValidator.java | 3 ++- .../schemas/validation/MinPropertiesValidator.java | 3 ++- .../client/schemas/validation/MinimumValidator.java | 3 ++- .../schemas/validation/MultipleOfValidator.java | 3 ++- .../client/schemas/validation/NotValidator.java | 3 ++- .../client/schemas/validation/OneOfValidator.java | 3 ++- .../client/schemas/validation/PatternValidator.java | 3 ++- .../schemas/validation/PropertiesValidator.java | 4 +++- .../client/schemas/validation/RequiredValidator.java | 3 ++- .../client/schemas/validation/TypeValidator.java | 3 ++- .../schemas/validation/UniqueItemsValidator.java | 3 ++- .../validation/AdditionalPropertiesValidator.hbs | 3 ++- .../schemas/validation/AllOfValidator.hbs | 3 ++- .../schemas/validation/AnyOfValidator.hbs | 3 ++- .../packagename/schemas/validation/EnumValidator.hbs | 3 ++- .../schemas/validation/ExclusiveMaximumValidator.hbs | 3 ++- .../schemas/validation/ExclusiveMinimumValidator.hbs | 3 ++- .../packagename/schemas/validation/FakeValidator.hbs | 4 +++- .../schemas/validation/FormatValidator.hbs | 3 ++- .../schemas/validation/ItemsValidator.hbs | 4 +++- .../packagename/schemas/validation/JsonSchema.hbs | 12 ++++++------ .../schemas/validation/KeywordValidator.hbs | 3 ++- .../schemas/validation/MaxItemsValidator.hbs | 3 ++- .../schemas/validation/MaxLengthValidator.hbs | 3 ++- .../schemas/validation/MaxPropertiesValidator.hbs | 3 ++- .../schemas/validation/MaximumValidator.hbs | 3 ++- .../schemas/validation/MinItemsValidator.hbs | 3 ++- .../schemas/validation/MinLengthValidator.hbs | 3 ++- .../schemas/validation/MinPropertiesValidator.hbs | 3 ++- .../schemas/validation/MinimumValidator.hbs | 3 ++- .../schemas/validation/MultipleOfValidator.hbs | 3 ++- .../packagename/schemas/validation/NotValidator.hbs | 3 ++- .../schemas/validation/OneOfValidator.hbs | 3 ++- .../schemas/validation/PatternValidator.hbs | 3 ++- .../schemas/validation/PropertiesValidator.hbs | 4 +++- .../schemas/validation/RequiredValidator.hbs | 3 ++- .../packagename/schemas/validation/TypeValidator.hbs | 3 ++- .../schemas/validation/UniqueItemsValidator.hbs | 3 ++- 54 files changed, 122 insertions(+), 64 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java index 5eaea40b69e..25eb18bdae2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java @@ -1,4 +1,5 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -20,7 +21,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java index 067021deaf6..6e56dee32f6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java @@ -1,4 +1,5 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.List; @@ -15,7 +16,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); for(Class allOfClass: allOf) { JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java index c3a911631a1..0c52bd93bb4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.List; @@ -18,7 +19,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); List> validatedAnyOfClasses = new ArrayList<>(); for(Class anyOfClass: anyOf) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java index c614dbac13f..32164c18e34 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; import java.util.Set; @@ -18,7 +19,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (enumValues.isEmpty()) { throw new ValidationException("No value can match enum because enum is empty"); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java index 92036b3bcea..5f7c07b5e55 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class ExclusiveMaximumValidator implements KeywordValidator { @@ -16,7 +17,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java index e8b46f9dbe9..ff15fa57a0c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class ExclusiveMinimumValidator implements KeywordValidator { @@ -16,7 +17,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java index c8c0ad1d93d..48e60e1a69d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java @@ -1,5 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; + public class FakeValidator implements KeywordValidator { @Override public Object getConstraint() { @@ -7,7 +9,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { return null; } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java index 9e6d941ebef..4c009ebe96e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; import java.math.BigInteger; @@ -147,7 +148,7 @@ private Void validateStringFormat(String arg, ValidationMetadata validationMetad } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (arg instanceof Number) { validateNumericFormat( (Number) arg, diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java index f20c26efdf5..0716b74b019 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java @@ -1,5 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; + import java.util.ArrayList; import java.util.List; @@ -16,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 6c095c6d111..9cac6d62202 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -221,7 +221,7 @@ protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { public static PathToSchemasMap validate( JsonSchema jsonSchema, - Object arg, + @Nullable Object arg, ValidationMetadata validationMetadata ) throws ValidationException { LinkedHashSet disabledKeywords = validationMetadata.configuration().disabledKeywordFlags().getKeywords(); @@ -276,7 +276,7 @@ protected Void castToAllowedTypes(Void arg, List pathToItem, Set castToAllowedTypes(List arg, List pathToItem, Set> pathSet) { pathSet.add(pathToItem); - List argFixed = new ArrayList<>(); + List<@Nullable Object> argFixed = new ArrayList<>(); int i =0; for (Object item: arg) { List newPathToItem = new ArrayList<>(pathToItem); @@ -290,10 +290,10 @@ protected List castToAllowedTypes(List arg, List pathToItem, Set castToAllowedTypes(Map arg, List pathToItem, Set> pathSet) { pathSet.add(pathToItem); - LinkedHashMap argFixed = new LinkedHashMap<>(); + LinkedHashMap argFixed = new LinkedHashMap<>(); for (Map.Entry entry: arg.entrySet()) { - String key = (String) entry.getKey(); - Object val = arg.get(entry.getKey()); + @NonNull String key = (@NonNull String) entry.getKey(); + Object val = entry.getValue(); List newPathToItem = new ArrayList<>(pathToItem); newPathToItem.add(key); Object fixedVal = castToAllowedObjectTypes(val, newPathToItem, pathSet); @@ -302,7 +302,7 @@ protected List castToAllowedTypes(List arg, List pathToItem, Set pathToItem, Set> pathSet) { + private @Nullable Object castToAllowedObjectTypes(@Nullable Object arg, List pathToItem, Set> pathSet) { if (arg == null) { return castToAllowedTypes((Void) null, pathToItem, pathSet); } else if (arg instanceof String) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java index 265e1ec3467..e2d34258a8c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java @@ -1,11 +1,12 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public interface KeywordValidator { PathToSchemasMap validate( JsonSchema schema, - Object arg, + @Nullable Object arg, ValidationMetadata validationMetadata) throws ValidationException; Object getConstraint(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java index 1391325b064..ba1ccae73b2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.List; @@ -17,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java index c6db775615f..1a93c223cb4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class MaxLengthValidator extends LengthValidator implements KeywordValidator { public final int maxLength; @@ -15,7 +16,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java index 8c9e11bb856..7cc1ea57c0f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.Map; @@ -17,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java index 73b5225e280..383c3ee9f42 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class MaximumValidator implements KeywordValidator { @@ -16,7 +17,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java index c8356d8b952..7a9b1d1c4fb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.List; @@ -17,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java index 62adaa68e69..ff8c81337f5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class MinLengthValidator extends LengthValidator implements KeywordValidator { public final int minLength; @@ -15,7 +16,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java index 33dec6abe0d..367a94ee895 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.Map; @@ -17,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java index 07017c768f0..f9e9cb9c2ae 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class MinimumValidator implements KeywordValidator { @@ -16,7 +17,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java index cde604e8581..144630ee118 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; @@ -31,7 +32,7 @@ private BigDecimal getBigDecimal(Number arg) { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java index 15b94614ecf..a7d252ad946 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -22,7 +23,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas; try { JsonSchema notSchema = JsonSchemaFactory.getInstance(not); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java index 4ce38a4e753..83b02c6c016 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.List; @@ -18,7 +19,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); List> validatedOneOfClasses = new ArrayList<>(); for(Class oneOfClass: oneOf) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java index c4c398147ee..59435ef4919 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.regex.Pattern; @@ -17,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java index dc652f79c9e..48654a888fb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java @@ -1,5 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; + import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; @@ -19,7 +21,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java index c73ae4e30fc..3d3994ecf5b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.List; @@ -20,7 +21,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java index 33d23b656fa..02c69e42c53 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.List; import java.util.Map; @@ -19,7 +20,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { Class argClass; if (arg == null) { argClass = Void.class; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java index 1034539e362..0390382c3f5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java @@ -1,6 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.List; @@ -19,7 +20,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs index 683c58a2883..17b5c67c857 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs @@ -1,4 +1,5 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -20,7 +21,7 @@ public class AdditionalPropertiesValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs index 0044ac84705..b18d22694ed 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs @@ -1,4 +1,5 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.List; @@ -15,7 +16,7 @@ public class AllOfValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); for(Class allOfClass: allOf) { JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs index e063abe37cc..a6b9e439970 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.List; @@ -18,7 +19,7 @@ public class AnyOfValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); List> validatedAnyOfClasses = new ArrayList<>(); for(Class anyOfClass: anyOf) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs index 805b9bc1ebe..5e8988a400a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; import java.util.Set; @@ -18,7 +19,7 @@ public class EnumValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (enumValues.isEmpty()) { throw new ValidationException("No value can match enum because enum is empty"); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs index b98de4cbf39..085da379117 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class ExclusiveMaximumValidator implements KeywordValidator { @@ -16,7 +17,7 @@ public class ExclusiveMaximumValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs index 07421f931a0..c137bd39fe2 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class ExclusiveMinimumValidator implements KeywordValidator { @@ -16,7 +17,7 @@ public class ExclusiveMinimumValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs index 0ae586d3258..c3eeeb74758 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs @@ -1,5 +1,7 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; + public class FakeValidator implements KeywordValidator { @Override public Object getConstraint() { @@ -7,7 +9,7 @@ public class FakeValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { return null; } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs index e8d2a36f299..b30ef432b62 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; import java.math.BigInteger; @@ -147,7 +148,7 @@ public class FormatValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (arg instanceof Number) { validateNumericFormat( (Number) arg, diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs index 938d194048a..4bf97bfac95 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs @@ -1,5 +1,7 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; + import java.util.ArrayList; import java.util.List; @@ -16,7 +18,7 @@ public class ItemsValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index 80ef2250ab9..770253f0d34 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -221,7 +221,7 @@ public abstract class JsonSchema { public static PathToSchemasMap validate( JsonSchema jsonSchema, - Object arg, + @Nullable Object arg, ValidationMetadata validationMetadata ) throws ValidationException { LinkedHashSet disabledKeywords = validationMetadata.configuration().disabledKeywordFlags().getKeywords(); @@ -276,7 +276,7 @@ public abstract class JsonSchema { protected List castToAllowedTypes(List arg, List pathToItem, Set> pathSet) { pathSet.add(pathToItem); - List argFixed = new ArrayList<>(); + List<@Nullable Object> argFixed = new ArrayList<>(); int i =0; for (Object item: arg) { List newPathToItem = new ArrayList<>(pathToItem); @@ -290,10 +290,10 @@ public abstract class JsonSchema { protected Map castToAllowedTypes(Map arg, List pathToItem, Set> pathSet) { pathSet.add(pathToItem); - LinkedHashMap argFixed = new LinkedHashMap<>(); + LinkedHashMap argFixed = new LinkedHashMap<>(); for (Map.Entry entry: arg.entrySet()) { - String key = (String) entry.getKey(); - Object val = arg.get(entry.getKey()); + @NonNull String key = (@NonNull String) entry.getKey(); + Object val = entry.getValue(); List newPathToItem = new ArrayList<>(pathToItem); newPathToItem.add(key); Object fixedVal = castToAllowedObjectTypes(val, newPathToItem, pathSet); @@ -302,7 +302,7 @@ public abstract class JsonSchema { return argFixed; } - private Object castToAllowedObjectTypes(@Nullable Object arg, List pathToItem, Set> pathSet) { + private @Nullable Object castToAllowedObjectTypes(@Nullable Object arg, List pathToItem, Set> pathSet) { if (arg == null) { return castToAllowedTypes((Void) null, pathToItem, pathSet); } else if (arg instanceof String) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs index c73259fa67f..c7663e35a8a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs @@ -1,11 +1,12 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public interface KeywordValidator { PathToSchemasMap validate( JsonSchema schema, - Object arg, + @Nullable Object arg, ValidationMetadata validationMetadata) throws ValidationException; Object getConstraint(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs index 04c6beeee98..174a4e4d918 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.List; @@ -17,7 +18,7 @@ public class MaxItemsValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs index 0a73606ef6b..20427bea6bc 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class MaxLengthValidator extends LengthValidator implements KeywordValidator { public final int maxLength; @@ -15,7 +16,7 @@ public class MaxLengthValidator extends LengthValidator implements KeywordValida } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs index 520f1cd8b7d..1fbf3769c0c 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.Map; @@ -17,7 +18,7 @@ public class MaxPropertiesValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs index 0359aa1a5c6..4a410bf321f 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class MaximumValidator implements KeywordValidator { @@ -16,7 +17,7 @@ public class MaximumValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs index 370ae58c1e0..20f9c5f142f 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.List; @@ -17,7 +18,7 @@ public class MinItemsValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs index d93b0b741e5..e1e9d53c987 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class MinLengthValidator extends LengthValidator implements KeywordValidator { public final int minLength; @@ -15,7 +16,7 @@ public class MinLengthValidator extends LengthValidator implements KeywordValida } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs index 1f7e6ae7521..cf26fc081d5 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.Map; @@ -17,7 +18,7 @@ public class MinPropertiesValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs index 23acd8c7913..58159131af1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; public class MinimumValidator implements KeywordValidator { @@ -16,7 +17,7 @@ public class MinimumValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs index 046d4079b99..5e3d350a66f 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; @@ -31,7 +32,7 @@ public class MultipleOfValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs index b8252d4ef1b..d5aa4e33efb 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -22,7 +23,7 @@ public class NotValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas; try { JsonSchema notSchema = JsonSchemaFactory.getInstance(not); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs index 0850b86dc08..e796fc52cd1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.List; @@ -18,7 +19,7 @@ public class OneOfValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); List> validatedOneOfClasses = new ArrayList<>(); for(Class oneOfClass: oneOf) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs index 0e537dd27fd..25b6e68a053 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.regex.Pattern; @@ -17,7 +18,7 @@ public class PatternValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs index 812ff962376..b6701089120 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs @@ -1,5 +1,7 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; + import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; @@ -19,7 +21,7 @@ public class PropertiesValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs index c6ced3be056..29da952d12b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.List; @@ -20,7 +21,7 @@ public class RequiredValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs index aa492962925..d9154296f6e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.List; import java.util.Map; @@ -19,7 +20,7 @@ public class TypeValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { Class argClass; if (arg == null) { argClass = Void.class; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs index b6ca39a0a05..2304521a42c 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs @@ -1,6 +1,7 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; +import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; import java.util.List; @@ -19,7 +20,7 @@ public class UniqueItemsValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, Object arg, ValidationMetadata validationMetadata) { + public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } From 8608c14f15d5b1914d8c9e4b888c222bd666df22 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 12:21:16 -0800 Subject: [PATCH 07/52] Fixes type issues in JsonSchema.java --- .../client/schemas/validation/JsonSchema.java | 8 +++++++- .../java/packagename/schemas/validation/JsonSchema.hbs | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 9cac6d62202..df901e2346b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -292,7 +292,13 @@ protected List castToAllowedTypes(List arg, List pathToItem, Set argFixed = new LinkedHashMap<>(); for (Map.Entry entry: arg.entrySet()) { - @NonNull String key = (@NonNull String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String key; + if (entryKey instanceof String) { + key = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } Object val = entry.getValue(); List newPathToItem = new ArrayList<>(pathToItem); newPathToItem.add(key); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index 770253f0d34..b83497d1b64 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -292,7 +292,13 @@ public abstract class JsonSchema { pathSet.add(pathToItem); LinkedHashMap argFixed = new LinkedHashMap<>(); for (Map.Entry entry: arg.entrySet()) { - @NonNull String key = (@NonNull String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String key; + if (entryKey instanceof String) { + key = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } Object val = entry.getValue(); List newPathToItem = new ArrayList<>(pathToItem); newPathToItem.add(key); From 323f3d0e48e285d62d4fdad844ed068e7f35184e Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 12:27:30 -0800 Subject: [PATCH 08/52] Adds Nullable return for KeywordValidator validate --- .../schemas/validation/AdditionalPropertiesValidator.java | 2 +- .../client/schemas/validation/AllOfValidator.java | 2 +- .../client/schemas/validation/AnyOfValidator.java | 2 +- .../client/schemas/validation/EnumValidator.java | 2 +- .../client/schemas/validation/ExclusiveMaximumValidator.java | 2 +- .../client/schemas/validation/ExclusiveMinimumValidator.java | 2 +- .../client/schemas/validation/FakeValidator.java | 2 +- .../client/schemas/validation/FormatValidator.java | 2 +- .../client/schemas/validation/ItemsValidator.java | 2 +- .../client/schemas/validation/JsonSchema.java | 2 +- .../client/schemas/validation/KeywordValidator.java | 2 +- .../client/schemas/validation/MaxItemsValidator.java | 2 +- .../client/schemas/validation/MaxLengthValidator.java | 2 +- .../client/schemas/validation/MaxPropertiesValidator.java | 2 +- .../client/schemas/validation/MaximumValidator.java | 2 +- .../client/schemas/validation/MinItemsValidator.java | 2 +- .../client/schemas/validation/MinLengthValidator.java | 2 +- .../client/schemas/validation/MinPropertiesValidator.java | 2 +- .../client/schemas/validation/MinimumValidator.java | 2 +- .../client/schemas/validation/MultipleOfValidator.java | 2 +- .../client/schemas/validation/NotValidator.java | 2 +- .../client/schemas/validation/OneOfValidator.java | 2 +- .../client/schemas/validation/PatternValidator.java | 2 +- .../client/schemas/validation/PropertiesValidator.java | 2 +- .../client/schemas/validation/RequiredValidator.java | 2 +- .../client/schemas/validation/TypeValidator.java | 2 +- .../client/schemas/validation/UniqueItemsValidator.java | 2 +- .../schemas/validation/AdditionalPropertiesValidator.hbs | 2 +- .../main/java/packagename/schemas/validation/AllOfValidator.hbs | 2 +- .../main/java/packagename/schemas/validation/AnyOfValidator.hbs | 2 +- .../main/java/packagename/schemas/validation/EnumValidator.hbs | 2 +- .../schemas/validation/ExclusiveMaximumValidator.hbs | 2 +- .../schemas/validation/ExclusiveMinimumValidator.hbs | 2 +- .../main/java/packagename/schemas/validation/FakeValidator.hbs | 2 +- .../java/packagename/schemas/validation/FormatValidator.hbs | 2 +- .../main/java/packagename/schemas/validation/ItemsValidator.hbs | 2 +- .../src/main/java/packagename/schemas/validation/JsonSchema.hbs | 2 +- .../java/packagename/schemas/validation/KeywordValidator.hbs | 2 +- .../java/packagename/schemas/validation/MaxItemsValidator.hbs | 2 +- .../java/packagename/schemas/validation/MaxLengthValidator.hbs | 2 +- .../packagename/schemas/validation/MaxPropertiesValidator.hbs | 2 +- .../java/packagename/schemas/validation/MaximumValidator.hbs | 2 +- .../java/packagename/schemas/validation/MinItemsValidator.hbs | 2 +- .../java/packagename/schemas/validation/MinLengthValidator.hbs | 2 +- .../packagename/schemas/validation/MinPropertiesValidator.hbs | 2 +- .../java/packagename/schemas/validation/MinimumValidator.hbs | 2 +- .../java/packagename/schemas/validation/MultipleOfValidator.hbs | 2 +- .../main/java/packagename/schemas/validation/NotValidator.hbs | 2 +- .../main/java/packagename/schemas/validation/OneOfValidator.hbs | 2 +- .../java/packagename/schemas/validation/PatternValidator.hbs | 2 +- .../java/packagename/schemas/validation/PropertiesValidator.hbs | 2 +- .../java/packagename/schemas/validation/RequiredValidator.hbs | 2 +- .../main/java/packagename/schemas/validation/TypeValidator.hbs | 2 +- .../packagename/schemas/validation/UniqueItemsValidator.hbs | 2 +- 54 files changed, 54 insertions(+), 54 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java index 25eb18bdae2..6ed58a53a2f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java @@ -21,7 +21,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java index 6e56dee32f6..081b68fa0f9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java @@ -16,7 +16,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); for(Class allOfClass: allOf) { JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java index 0c52bd93bb4..c62853bf838 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java @@ -19,7 +19,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); List> validatedAnyOfClasses = new ArrayList<>(); for(Class anyOfClass: anyOf) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java index 32164c18e34..8165ae215cd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java @@ -19,7 +19,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (enumValues.isEmpty()) { throw new ValidationException("No value can match enum because enum is empty"); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java index 5f7c07b5e55..abd430e4135 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java @@ -17,7 +17,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java index ff15fa57a0c..885368ec8d3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java @@ -17,7 +17,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java index 48e60e1a69d..b23344a78f2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java @@ -9,7 +9,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { return null; } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java index 4c009ebe96e..7b36bcac5b9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java @@ -148,7 +148,7 @@ private Void validateStringFormat(String arg, ValidationMetadata validationMetad } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (arg instanceof Number) { validateNumericFormat( (Number) arg, diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java index 0716b74b019..1c580d45abe 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java @@ -18,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index df901e2346b..08205996e1e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -233,7 +233,7 @@ public static PathToSchemasMap validate( continue; } KeywordValidator validator = entry.getValue(); - PathToSchemasMap otherPathToSchemas = validator.validate( + @Nullable PathToSchemasMap otherPathToSchemas = validator.validate( jsonSchema, arg, validationMetadata diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java index e2d34258a8c..b27aba5533d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java @@ -4,7 +4,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; public interface KeywordValidator { - PathToSchemasMap validate( + @Nullable PathToSchemasMap validate( JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) throws ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java index ba1ccae73b2..437077dc57e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java @@ -18,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java index 1a93c223cb4..aa9715308de 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java @@ -16,7 +16,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java index 7cc1ea57c0f..9f06ed048c6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java @@ -18,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java index 383c3ee9f42..bfae8cd1856 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java @@ -17,7 +17,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java index 7a9b1d1c4fb..2d3dd39cb27 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java @@ -18,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java index ff8c81337f5..a5d30be2edf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java @@ -16,7 +16,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java index 367a94ee895..a72541422dc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java @@ -18,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java index f9e9cb9c2ae..8fe8aee5e49 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java @@ -17,7 +17,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java index 144630ee118..c33c8e85757 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java @@ -32,7 +32,7 @@ private BigDecimal getBigDecimal(Number arg) { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java index a7d252ad946..1df78a0a217 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java @@ -23,7 +23,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas; try { JsonSchema notSchema = JsonSchemaFactory.getInstance(not); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java index 83b02c6c016..899742552e7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java @@ -19,7 +19,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); List> validatedOneOfClasses = new ArrayList<>(); for(Class oneOfClass: oneOf) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java index 59435ef4919..d5fc882f2a7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java @@ -18,7 +18,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java index 48654a888fb..e5e383d47c8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java @@ -21,7 +21,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java index 3d3994ecf5b..6d9f0361187 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java @@ -21,7 +21,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java index 02c69e42c53..5e4c73da2c6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java @@ -20,7 +20,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { Class argClass; if (arg == null) { argClass = Void.class; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java index 0390382c3f5..67540b42a8f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java @@ -20,7 +20,7 @@ public Object getConstraint() { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs index 17b5c67c857..00eedd6b1fd 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs @@ -21,7 +21,7 @@ public class AdditionalPropertiesValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs index b18d22694ed..d5b1bf6ac28 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs @@ -16,7 +16,7 @@ public class AllOfValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); for(Class allOfClass: allOf) { JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs index a6b9e439970..4a2cb5b1128 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs @@ -19,7 +19,7 @@ public class AnyOfValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); List> validatedAnyOfClasses = new ArrayList<>(); for(Class anyOfClass: anyOf) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs index 5e8988a400a..2ae8c177a9d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs @@ -19,7 +19,7 @@ public class EnumValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (enumValues.isEmpty()) { throw new ValidationException("No value can match enum because enum is empty"); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs index 085da379117..78249e04b2f 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs @@ -17,7 +17,7 @@ public class ExclusiveMaximumValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs index c137bd39fe2..beef0da5385 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs @@ -17,7 +17,7 @@ public class ExclusiveMinimumValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs index c3eeeb74758..d3795c4f51c 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs @@ -9,7 +9,7 @@ public class FakeValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { return null; } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs index b30ef432b62..5c6995866fd 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs @@ -148,7 +148,7 @@ public class FormatValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (arg instanceof Number) { validateNumericFormat( (Number) arg, diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs index 4bf97bfac95..aa63e0712cb 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs @@ -18,7 +18,7 @@ public class ItemsValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index b83497d1b64..003977c8644 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -233,7 +233,7 @@ public abstract class JsonSchema { continue; } KeywordValidator validator = entry.getValue(); - PathToSchemasMap otherPathToSchemas = validator.validate( + @Nullable PathToSchemasMap otherPathToSchemas = validator.validate( jsonSchema, arg, validationMetadata diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs index c7663e35a8a..2da5a78122d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs @@ -4,7 +4,7 @@ import {{{packageName}}}.exceptions.ValidationException; import org.checkerframework.checker.nullness.qual.Nullable; public interface KeywordValidator { - PathToSchemasMap validate( + @Nullable PathToSchemasMap validate( JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) throws ValidationException; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs index 174a4e4d918..3a65b75292a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs @@ -18,7 +18,7 @@ public class MaxItemsValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs index 20427bea6bc..1f271b64b8b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs @@ -16,7 +16,7 @@ public class MaxLengthValidator extends LengthValidator implements KeywordValida } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs index 1fbf3769c0c..e0217a69929 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs @@ -18,7 +18,7 @@ public class MaxPropertiesValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs index 4a410bf321f..b2a8e273c6e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs @@ -17,7 +17,7 @@ public class MaximumValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs index 20f9c5f142f..4e5cb6b1263 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs @@ -18,7 +18,7 @@ public class MinItemsValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs index e1e9d53c987..6fc8054a9e1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs @@ -16,7 +16,7 @@ public class MinLengthValidator extends LengthValidator implements KeywordValida } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs index cf26fc081d5..39ae246f835 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs @@ -18,7 +18,7 @@ public class MinPropertiesValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs index 58159131af1..3a4eeed49bf 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs @@ -17,7 +17,7 @@ public class MinimumValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs index 5e3d350a66f..016bfa5bb3e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs @@ -32,7 +32,7 @@ public class MultipleOfValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs index d5aa4e33efb..50ba2040114 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs @@ -23,7 +23,7 @@ public class NotValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas; try { JsonSchema notSchema = JsonSchemaFactory.getInstance(not); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs index e796fc52cd1..0d2d784f1f4 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs @@ -19,7 +19,7 @@ public class OneOfValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); List> validatedOneOfClasses = new ArrayList<>(); for(Class oneOfClass: oneOf) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs index 25b6e68a053..b4193198b61 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs @@ -18,7 +18,7 @@ public class PatternValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs index b6701089120..63327083c58 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs @@ -21,7 +21,7 @@ public class PropertiesValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs index 29da952d12b..4cb44eda733 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs @@ -21,7 +21,7 @@ public class RequiredValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { return null; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs index d9154296f6e..31701e92a85 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs @@ -20,7 +20,7 @@ public class TypeValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { Class argClass; if (arg == null) { argClass = Void.class; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs index 2304521a42c..bbf4841568d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs @@ -20,7 +20,7 @@ public class UniqueItemsValidator implements KeywordValidator { } @Override - public PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { + public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { return null; } From 2bb63d6f15bb6fb7e5931723a904a3bfc3ea3af6 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 12:53:40 -0800 Subject: [PATCH 09/52] Adds supression of seaierliazable class warnings --- .../openapijsonschematools/client/exceptions/BaseException.java | 1 + .../client/exceptions/InvalidAdditionalPropertyException.java | 1 + .../client/exceptions/InvalidTypeException.java | 1 + .../client/exceptions/UnsetPropertyException.java | 1 + .../client/exceptions/ValidationException.java | 1 + .../client/schemas/validation/KeywordEntry.java | 1 + .../client/schemas/validation/PropertyEntry.java | 1 + .../java/src/main/java/packagename/exceptions/BaseException.hbs | 1 + .../exceptions/InvalidAdditionalPropertyException.hbs | 1 + .../main/java/packagename/exceptions/InvalidTypeException.hbs | 1 + .../main/java/packagename/exceptions/UnsetPropertyException.hbs | 1 + .../src/main/java/packagename/exceptions/ValidationException.hbs | 1 + .../main/java/packagename/schemas/validation/KeywordEntry.hbs | 1 + .../java/packagename/schemas/validation/PathToSchemasMap.hbs | 1 + .../main/java/packagename/schemas/validation/PropertyEntry.hbs | 1 + 15 files changed, 15 insertions(+) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/BaseException.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/BaseException.java index 4fd46019607..3d7b352080c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/BaseException.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/BaseException.java @@ -1,4 +1,5 @@ package org.openapijsonschematools.client.exceptions; +@SuppressWarnings("serial") public class BaseException extends RuntimeException { } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/InvalidAdditionalPropertyException.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/InvalidAdditionalPropertyException.java index 06e1596b99e..7f0805b1be8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/InvalidAdditionalPropertyException.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/InvalidAdditionalPropertyException.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.exceptions; +@SuppressWarnings("serial") public class InvalidAdditionalPropertyException extends BaseException { public InvalidAdditionalPropertyException(String s) { super(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/InvalidTypeException.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/InvalidTypeException.java index 01d1c5f38e4..73fafa999af 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/InvalidTypeException.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/InvalidTypeException.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.exceptions; +@SuppressWarnings("serial") public class InvalidTypeException extends BaseException { public InvalidTypeException(String s) { super(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/UnsetPropertyException.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/UnsetPropertyException.java index 81d77b763f4..cb743b6a97c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/UnsetPropertyException.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/UnsetPropertyException.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.exceptions; +@SuppressWarnings("serial") public class UnsetPropertyException extends BaseException { public UnsetPropertyException(String s) { super(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/ValidationException.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/ValidationException.java index c88035bf089..8c217a9f9dc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/ValidationException.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/exceptions/ValidationException.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.exceptions; +@SuppressWarnings("serial") public class ValidationException extends BaseException { public ValidationException(String s) { super(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordEntry.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordEntry.java index 647b930ba4c..c00f0c4804e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordEntry.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordEntry.java @@ -2,6 +2,7 @@ import java.util.AbstractMap; +@SuppressWarnings("serial") public class KeywordEntry extends AbstractMap.SimpleEntry { public KeywordEntry(String key, KeywordValidator value) { super(key, value); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java index 2d9d81a0196..aaaede643a0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java @@ -2,6 +2,7 @@ import java.util.AbstractMap; +@SuppressWarnings("serial") public class PropertyEntry extends AbstractMap.SimpleEntry> { public PropertyEntry(String key, Class value) { super(key, value); diff --git a/src/main/resources/java/src/main/java/packagename/exceptions/BaseException.hbs b/src/main/resources/java/src/main/java/packagename/exceptions/BaseException.hbs index 44b738dbf67..5c79af60205 100644 --- a/src/main/resources/java/src/main/java/packagename/exceptions/BaseException.hbs +++ b/src/main/resources/java/src/main/java/packagename/exceptions/BaseException.hbs @@ -1,4 +1,5 @@ package {{{packageName}}}.exceptions; +@SuppressWarnings("serial") public class BaseException extends RuntimeException { } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/exceptions/InvalidAdditionalPropertyException.hbs b/src/main/resources/java/src/main/java/packagename/exceptions/InvalidAdditionalPropertyException.hbs index 8a17f15c6f4..b7948c64791 100644 --- a/src/main/resources/java/src/main/java/packagename/exceptions/InvalidAdditionalPropertyException.hbs +++ b/src/main/resources/java/src/main/java/packagename/exceptions/InvalidAdditionalPropertyException.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.exceptions; +@SuppressWarnings("serial") public class InvalidAdditionalPropertyException extends BaseException { public InvalidAdditionalPropertyException(String s) { super(); diff --git a/src/main/resources/java/src/main/java/packagename/exceptions/InvalidTypeException.hbs b/src/main/resources/java/src/main/java/packagename/exceptions/InvalidTypeException.hbs index 585132ddcc1..e5e1455ffc0 100644 --- a/src/main/resources/java/src/main/java/packagename/exceptions/InvalidTypeException.hbs +++ b/src/main/resources/java/src/main/java/packagename/exceptions/InvalidTypeException.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.exceptions; +@SuppressWarnings("serial") public class InvalidTypeException extends BaseException { public InvalidTypeException(String s) { super(); diff --git a/src/main/resources/java/src/main/java/packagename/exceptions/UnsetPropertyException.hbs b/src/main/resources/java/src/main/java/packagename/exceptions/UnsetPropertyException.hbs index 63a5699df08..fd37bec8d71 100644 --- a/src/main/resources/java/src/main/java/packagename/exceptions/UnsetPropertyException.hbs +++ b/src/main/resources/java/src/main/java/packagename/exceptions/UnsetPropertyException.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.exceptions; +@SuppressWarnings("serial") public class UnsetPropertyException extends BaseException { public UnsetPropertyException(String s) { super(); diff --git a/src/main/resources/java/src/main/java/packagename/exceptions/ValidationException.hbs b/src/main/resources/java/src/main/java/packagename/exceptions/ValidationException.hbs index 2b7bacfb80a..7a0e0a43af2 100644 --- a/src/main/resources/java/src/main/java/packagename/exceptions/ValidationException.hbs +++ b/src/main/resources/java/src/main/java/packagename/exceptions/ValidationException.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.exceptions; +@SuppressWarnings("serial") public class ValidationException extends BaseException { public ValidationException(String s) { super(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordEntry.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordEntry.hbs index 8002aaf682d..7f5a8c70c02 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordEntry.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordEntry.hbs @@ -2,6 +2,7 @@ package {{{packageName}}}.schemas.validation; import java.util.AbstractMap; +@SuppressWarnings("serial") public class KeywordEntry extends AbstractMap.SimpleEntry { public KeywordEntry(String key, KeywordValidator value) { super(key, value); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PathToSchemasMap.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PathToSchemasMap.hbs index b9c218e13ac..83ddc2233e4 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PathToSchemasMap.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PathToSchemasMap.hbs @@ -4,6 +4,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +@SuppressWarnings("serial") public class PathToSchemasMap extends LinkedHashMap, LinkedHashMap> { public void update(PathToSchemasMap other) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyEntry.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyEntry.hbs index 619b756d7a3..8d3d3840474 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyEntry.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyEntry.hbs @@ -2,6 +2,7 @@ package {{{packageName}}}.schemas.validation; import java.util.AbstractMap; +@SuppressWarnings("serial") public class PropertyEntry extends AbstractMap.SimpleEntry> { public PropertyEntry(String key, Class value) { super(key, value); From ca4596831cc349c830af97a0c7f1317a38bbb4c8 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 12:59:44 -0800 Subject: [PATCH 10/52] Adds @Nullable as the return type of shcema getNewInstance with object input --- ...itionalpropertiesAllowsASchemaWhichShouldValidate.java | 2 +- .../schemas/AdditionalpropertiesAreAllowedByDefault.java | 2 +- .../schemas/AdditionalpropertiesCanExistByItself.java | 2 +- .../AdditionalpropertiesShouldNotLookInApplicators.java | 4 ++-- .../client/components/schemas/Allof.java | 6 +++--- .../components/schemas/AllofCombinedWithAnyofOneof.java | 8 ++++---- .../client/components/schemas/AllofSimpleTypes.java | 6 +++--- .../client/components/schemas/AllofWithBaseSchema.java | 6 +++--- .../components/schemas/AllofWithOneEmptySchema.java | 2 +- .../components/schemas/AllofWithTheFirstEmptySchema.java | 2 +- .../components/schemas/AllofWithTheLastEmptySchema.java | 2 +- .../components/schemas/AllofWithTwoEmptySchemas.java | 2 +- .../client/components/schemas/Anyof.java | 4 ++-- .../client/components/schemas/AnyofComplexTypes.java | 6 +++--- .../client/components/schemas/AnyofWithBaseSchema.java | 6 +++--- .../components/schemas/AnyofWithOneEmptySchema.java | 2 +- .../client/components/schemas/ArrayTypeMatchesArrays.java | 2 +- .../client/components/schemas/ByInt.java | 2 +- .../client/components/schemas/ByNumber.java | 2 +- .../client/components/schemas/BySmallNumber.java | 2 +- .../client/components/schemas/DateTimeFormat.java | 2 +- .../client/components/schemas/EmailFormat.java | 2 +- .../components/schemas/EnumWith0DoesNotMatchFalse.java | 2 +- .../components/schemas/EnumWith1DoesNotMatchTrue.java | 2 +- .../components/schemas/EnumWithEscapedCharacters.java | 2 +- .../components/schemas/EnumWithFalseDoesNotMatch0.java | 2 +- .../components/schemas/EnumWithTrueDoesNotMatch1.java | 2 +- .../client/components/schemas/EnumsInProperties.java | 6 +++--- .../client/components/schemas/ForbiddenProperty.java | 2 +- .../client/components/schemas/HostnameFormat.java | 2 +- ...idInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java | 2 +- .../components/schemas/InvalidStringValueForDefault.java | 4 ++-- .../client/components/schemas/Ipv4Format.java | 2 +- .../client/components/schemas/Ipv6Format.java | 2 +- .../client/components/schemas/JsonPointerFormat.java | 2 +- .../client/components/schemas/MaximumValidation.java | 2 +- .../schemas/MaximumValidationWithUnsignedInteger.java | 2 +- .../client/components/schemas/MaxitemsValidation.java | 2 +- .../client/components/schemas/MaxlengthValidation.java | 2 +- .../schemas/Maxproperties0MeansTheObjectIsEmpty.java | 2 +- .../components/schemas/MaxpropertiesValidation.java | 2 +- .../client/components/schemas/MinimumValidation.java | 2 +- .../schemas/MinimumValidationWithSignedInteger.java | 2 +- .../client/components/schemas/MinitemsValidation.java | 2 +- .../client/components/schemas/MinlengthValidation.java | 2 +- .../components/schemas/MinpropertiesValidation.java | 2 +- .../schemas/NestedAllofToCheckValidationSemantics.java | 4 ++-- .../schemas/NestedAnyofToCheckValidationSemantics.java | 4 ++-- .../client/components/schemas/NestedItems.java | 8 ++++---- .../schemas/NestedOneofToCheckValidationSemantics.java | 4 ++-- .../client/components/schemas/Not.java | 2 +- .../client/components/schemas/NotMoreComplexSchema.java | 4 ++-- .../client/components/schemas/NulCharactersInStrings.java | 2 +- .../components/schemas/ObjectPropertiesValidation.java | 2 +- .../client/components/schemas/Oneof.java | 4 ++-- .../client/components/schemas/OneofComplexTypes.java | 6 +++--- .../client/components/schemas/OneofWithBaseSchema.java | 6 +++--- .../client/components/schemas/OneofWithEmptySchema.java | 2 +- .../client/components/schemas/OneofWithRequired.java | 6 +++--- .../client/components/schemas/PatternIsNotAnchored.java | 2 +- .../client/components/schemas/PatternValidation.java | 2 +- .../schemas/PropertiesWithEscapedCharacters.java | 2 +- .../schemas/PropertyNamedRefThatIsNotAReference.java | 2 +- .../components/schemas/RefInAdditionalproperties.java | 2 +- .../client/components/schemas/RefInAllof.java | 2 +- .../client/components/schemas/RefInAnyof.java | 2 +- .../client/components/schemas/RefInItems.java | 2 +- .../client/components/schemas/RefInNot.java | 2 +- .../client/components/schemas/RefInOneof.java | 2 +- .../client/components/schemas/RefInProperty.java | 2 +- .../components/schemas/RequiredDefaultValidation.java | 2 +- .../client/components/schemas/RequiredValidation.java | 2 +- .../client/components/schemas/RequiredWithEmptyArray.java | 2 +- .../components/schemas/RequiredWithEscapedCharacters.java | 2 +- .../client/components/schemas/SimpleEnumValidation.java | 2 +- ...ultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java | 4 ++-- .../components/schemas/UniqueitemsFalseValidation.java | 2 +- .../client/components/schemas/UniqueitemsValidation.java | 2 +- .../client/components/schemas/UriFormat.java | 2 +- .../client/components/schemas/UriReferenceFormat.java | 2 +- .../client/components/schemas/UriTemplateFormat.java | 2 +- .../client/schemas/AnyTypeJsonSchema.java | 2 +- .../client/schemas/NotAnyTypeJsonSchema.java | 2 +- .../client/schemas/validation/JsonSchema.java | 2 +- .../client/schemas/validation/PathToSchemasMap.java | 1 + .../client/schemas/validation/UnsetAnyTypeJsonSchema.java | 2 +- .../SchemaClass/_getNewInstanceObject_implementor.hbs | 2 +- .../main/java/packagename/schemas/AnyTypeJsonSchema.hbs | 2 +- .../java/packagename/schemas/NotAnyTypeJsonSchema.hbs | 2 +- .../java/packagename/schemas/validation/JsonSchema.hbs | 2 +- .../schemas/validation/UnsetAnyTypeJsonSchema.hbs | 2 +- 91 files changed, 124 insertions(+), 123 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 80ba0c510d3..b67a5f0f080 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -126,7 +126,7 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap validate(Map pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index 53f9b81745c..d3f7e36d46a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -239,7 +239,7 @@ public AdditionalpropertiesAreAllowedByDefaultMap validate(Map a } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index fcb0ef7f68b..0e481a60fc3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -99,7 +99,7 @@ public AdditionalpropertiesCanExistByItselfMap validate(Map arg @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index d3e231759ea..34fc4dcbf2d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -226,7 +226,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -427,7 +427,7 @@ public AdditionalpropertiesShouldNotLookInApplicatorsMap validate(Map pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 3c39440f721..02179fe53c1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -224,7 +224,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -431,7 +431,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -612,7 +612,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index 347a68cd3ec..34fce5223af 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -187,7 +187,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -359,7 +359,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -531,7 +531,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -717,7 +717,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index 9151cb850ba..f9b6e4cfc0b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -186,7 +186,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -358,7 +358,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -539,7 +539,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index bedb4808c11..ff231dba317 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -225,7 +225,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -432,7 +432,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -649,7 +649,7 @@ public AllofWithBaseSchemaMap validate(Map arg, SchemaConfigurat } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index 2d1e423ea11..b1de1f8ddbd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -198,7 +198,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 3ef1bcba9d1..f7dc5307c26 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -203,7 +203,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index cd2ac25bf01..3b72be12d90 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -203,7 +203,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index 81e01bcbf8c..3501e1a9740 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -202,7 +202,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index ccd844c7106..c3b9e9ea0d8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -190,7 +190,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -371,7 +371,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 95cc2cd4448..cbec5075bc6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -224,7 +224,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -431,7 +431,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -612,7 +612,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index 5742fa500ab..5c2c8351c5d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -186,7 +186,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -358,7 +358,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -417,7 +417,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index d0d69b48482..b41831ca24d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -203,7 +203,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java index 3625ffc50ba..146c7582906 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java @@ -93,7 +93,7 @@ public ArrayTypeMatchesArraysList validate(List arg, SchemaConfiguration } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 33b5ee41d54..4464bc3d5c6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -193,7 +193,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 2b358c4e896..ccd8ccc1014 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -193,7 +193,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index 8fa41798ac7..09741744625 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -193,7 +193,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 54d5963b527..457a7efc786 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index f3fea3e8c59..77907c8a5de 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java index 8e066fd2a7c..c84eff9ac01 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java @@ -81,7 +81,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java index ac3f803a47b..6e1924a70fb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java @@ -81,7 +81,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java index cab5d40d4eb..243d74eb59a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java @@ -64,7 +64,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java index 5bcc9cd18be..0cded3cd165 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java @@ -61,7 +61,7 @@ public boolean validate(boolean arg, SchemaConfiguration configuration) throws V } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Boolean) { boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java index 09ec1f87083..ad28158bc5e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java @@ -61,7 +61,7 @@ public boolean validate(boolean arg, SchemaConfiguration configuration) throws V } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Boolean) { boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index c9e01b5b2b9..f112cfdd8eb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -60,7 +60,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } @@ -101,7 +101,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } @@ -201,7 +201,7 @@ public EnumsInPropertiesMap validate(Map arg, SchemaConfiguratio @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 942866d98e3..6730e5bd14d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -230,7 +230,7 @@ public ForbiddenPropertyMap validate(Map arg, SchemaConfiguratio } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 0f47b23645e..b6efe77fe52 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java index 080d7ec0b22..a5e037660ec 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java @@ -80,7 +80,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 595710e517b..0aa8b5bcf18 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -65,7 +65,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } @@ -263,7 +263,7 @@ public InvalidStringValueForDefaultMap validate(Map arg, SchemaC } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index 89d4b535fc1..48f4f1ff2ca 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index 734ada2463e..ddc79482063 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 9a8b128a9a9..203287cb637 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 1e51d18b6e1..3119087aa8b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 52e0467fa11..e118cb495f7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index b4448653d98..29cb0dd90fb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index cb225d0531b..919b562302d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index af0f9dc28a2..e4c6080e4bb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index 9c9e7241e69..b91bc36e676 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index ab2b3eb85d0..848b5bd85cf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index ac8a0bbb111..218e48b13e8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index 06c13c7ef6a..4d71b78c471 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 13efee53a2a..0ef62c308b4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index cacfeedeb4f..377fde35cb6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 1d3708dbc75..89bb85d9d2c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -372,7 +372,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index 8ea3cb09407..973250eaa96 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -372,7 +372,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index 5db25c41be8..b27a4291f2b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -87,7 +87,7 @@ public ItemsList validate(List arg, SchemaConfiguration configuration) t } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } @@ -154,7 +154,7 @@ public ItemsList1 validate(List> arg, SchemaConfiguration configura } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } @@ -221,7 +221,7 @@ public ItemsList2 validate(List>> arg, SchemaConfiguration con } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } @@ -294,7 +294,7 @@ public NestedItemsList validate(List>>> arg, SchemaConfig } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index c048632decb..826fc8692d2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -372,7 +372,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index 623d8006ace..8b75c184853 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -196,7 +196,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index ccf4753fbe8..593422ca570 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -114,7 +114,7 @@ public NotMap validate(Map arg, SchemaConfiguration configuratio @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } @@ -282,7 +282,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java index bfc8168a7db..a29cfc8d980 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java @@ -63,7 +63,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index f489bfeb4e9..8bc4d038a9a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -240,7 +240,7 @@ public ObjectPropertiesValidationMap validate(Map arg, SchemaCon } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index 20b63261434..7a6e1fd0be6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -190,7 +190,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -371,7 +371,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index 2f84f4d062c..ba1642ab4df 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -224,7 +224,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -431,7 +431,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -612,7 +612,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index 50d77f8c401..a3702fc06b3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -186,7 +186,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -358,7 +358,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -417,7 +417,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index ae9c5fcc0e3..310fb2009a0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -203,7 +203,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 83707c7dbdb..a6216aeae3a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -221,7 +221,7 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -428,7 +428,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { @@ -501,7 +501,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index 9b3b9a09fe5..41cd098df78 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -195,7 +195,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index c13e9ccb6f4..5621d7b7c1a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -195,7 +195,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 6986a3b7f13..c480d239538 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -247,7 +247,7 @@ public PropertiesWithEscapedCharactersMap validate(Map arg, Sche } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 20a31a4c812..b3902d894b1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -222,7 +222,7 @@ public PropertyNamedRefThatIsNotAReferenceMap validate(Map arg, } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 3b1dbe02083..4309f66741a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -95,7 +95,7 @@ public RefInAdditionalpropertiesMap validate(Map arg, SchemaConf @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index d04e3883c02..a68f5083da5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -194,7 +194,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index da083a33fd4..2c2076c45a4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -194,7 +194,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java index 5df588dbb4a..b11c7d3ee5f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java @@ -89,7 +89,7 @@ public RefInItemsList validate(List arg, SchemaConfiguration configurati } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index a89ca9d64c2..3e365fd1c6a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index 9a6c60751fd..c45be75cd78 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -194,7 +194,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index 2cbdf938ec6..567b49f8561 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -224,7 +224,7 @@ public RefInPropertyMap validate(Map arg, SchemaConfiguration co } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 49595beea96..ae24760969a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -228,7 +228,7 @@ public RequiredDefaultValidationMap validate(Map arg, SchemaConf } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index da6636927a1..4a2ada82353 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -241,7 +241,7 @@ public RequiredValidationMap validate(Map arg, SchemaConfigurati } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index 87449c5b664..ea958d2818d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -228,7 +228,7 @@ public RequiredWithEmptyArrayMap validate(Map arg, SchemaConfigu } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index 39587db3ed8..13ce5956a26 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -227,7 +227,7 @@ public RequiredWithEscapedCharactersMap validate(Map arg, Schema } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java index e9194b3388e..b6a62e42134 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java @@ -83,7 +83,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index e618ba8975d..3d3e4e90fb9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -75,7 +75,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } @@ -165,7 +165,7 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap validate(Map< @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index 730ade0368f..bd4d0ddca56 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 0253ef8cb36..3cd86eeeef1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index 2fcf9afdb5f..736f74182bd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index 86d57cde464..5233de7ab2b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index 48e67c78497..12b70b784c4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -192,7 +192,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index 614c5867f94..b39e63abd88 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -182,7 +182,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index 64050392ab2..03e577d1909 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -184,7 +184,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 08205996e1e..8b9720f8634 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -217,7 +217,7 @@ protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { this.keywordToValidator = keywordToValidator; } - public abstract Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas); + public abstract @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas); public static PathToSchemasMap validate( JsonSchema jsonSchema, diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java index 54a326630bc..6e199334d4c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; +@SuppressWarnings("serial") public class PathToSchemasMap extends LinkedHashMap, LinkedHashMap> { public void update(PathToSchemasMap other) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index 3e61f7713e6..022b9a14e60 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -170,7 +170,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs index cdfef4ba453..28ecaca28b6 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor.hbs @@ -1,6 +1,6 @@ @Override -public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { +public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { {{#if types}} {{#each types}} {{#if @first}} diff --git a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs index 2e4ee342019..9ff34c720de 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs @@ -182,7 +182,7 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs index a1ec17a80d1..976801ddf2c 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs @@ -184,7 +184,7 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index 003977c8644..9afa445cd3f 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -217,7 +217,7 @@ public abstract class JsonSchema { this.keywordToValidator = keywordToValidator; } - public abstract Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas); + public abstract @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas); public static PathToSchemasMap validate( JsonSchema jsonSchema, diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs index 747e8009ee2..256272ee105 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs @@ -170,7 +170,7 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } else if (arg instanceof Boolean) { From f846c80a3ad2ce12467db6b6f6731ac6f030b72b Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 13:10:27 -0800 Subject: [PATCH 11/52] Adds more nullable annotations --- .../client/schemas/BooleanJsonSchema.java | 2 +- .../openapijsonschematools/client/schemas/DateJsonSchema.java | 2 +- .../client/schemas/DateTimeJsonSchema.java | 2 +- .../client/schemas/DecimalJsonSchema.java | 2 +- .../client/schemas/DoubleJsonSchema.java | 2 +- .../openapijsonschematools/client/schemas/FloatJsonSchema.java | 2 +- .../openapijsonschematools/client/schemas/Int32JsonSchema.java | 2 +- .../openapijsonschematools/client/schemas/Int64JsonSchema.java | 2 +- .../openapijsonschematools/client/schemas/IntJsonSchema.java | 2 +- .../openapijsonschematools/client/schemas/ListJsonSchema.java | 2 +- .../openapijsonschematools/client/schemas/MapJsonSchema.java | 2 +- .../openapijsonschematools/client/schemas/NullJsonSchema.java | 2 +- .../client/schemas/NumberJsonSchema.java | 2 +- .../client/schemas/StringJsonSchema.java | 2 +- .../openapijsonschematools/client/schemas/UuidJsonSchema.java | 2 +- .../client/schemas/validation/FrozenMap.java | 2 +- .../client/schemas/validation/ItemsValidator.java | 3 +-- .../src/main/java/packagename/schemas/BooleanJsonSchema.hbs | 2 +- .../java/src/main/java/packagename/schemas/DateJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/DateTimeJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/DecimalJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/DoubleJsonSchema.hbs | 2 +- .../java/src/main/java/packagename/schemas/FloatJsonSchema.hbs | 2 +- .../java/src/main/java/packagename/schemas/Int32JsonSchema.hbs | 2 +- .../java/src/main/java/packagename/schemas/Int64JsonSchema.hbs | 2 +- .../java/src/main/java/packagename/schemas/IntJsonSchema.hbs | 2 +- .../java/src/main/java/packagename/schemas/ListJsonSchema.hbs | 2 +- .../java/src/main/java/packagename/schemas/MapJsonSchema.hbs | 2 +- .../java/src/main/java/packagename/schemas/NullJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/NumberJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/StringJsonSchema.hbs | 2 +- .../java/src/main/java/packagename/schemas/UuidJsonSchema.hbs | 2 +- .../src/main/java/packagename/schemas/validation/FrozenMap.hbs | 2 +- .../java/packagename/schemas/validation/ItemsValidator.hbs | 3 +-- 34 files changed, 34 insertions(+), 36 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java index 9b485af2bf8..69773b620f9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java @@ -55,7 +55,7 @@ public boolean validate(boolean arg, SchemaConfiguration configuration) throws V } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Boolean) { boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java index 399b3400a4b..063934fa21b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -59,7 +59,7 @@ public static DateJsonSchema getInstance() { } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java index 1a9d3bcd462..440ac05aa0b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java @@ -62,7 +62,7 @@ public String validate(ZonedDateTime arg, SchemaConfiguration configuration) thr } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java index 8e9b6726281..fad2a9424a5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java @@ -57,7 +57,7 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java index d86477abd29..760eae85a29 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java @@ -61,7 +61,7 @@ public double validate(double arg, SchemaConfiguration configuration) { } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java index 98d11714178..599fa3a1ffd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java @@ -61,7 +61,7 @@ public float validate(float arg, SchemaConfiguration configuration) { } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java index b30a195b1f3..7f0bef1fe68 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java @@ -68,7 +68,7 @@ public float validate(float arg, SchemaConfiguration configuration) throws Valid } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java index d200b662449..dbf21d5a5b8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java @@ -78,7 +78,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java index 7d06f3b8c7e..39b53f5c306 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java @@ -78,7 +78,7 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java index 4acfec0c5d2..e6dd85e9028 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java @@ -65,7 +65,7 @@ public FrozenList validate(List arg, SchemaConfiguration configu } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index 2d8281f3a17..c9302eac3da 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -65,7 +65,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java index 0608e165e74..d98deb843d9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java @@ -55,7 +55,7 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java index baad71eef6a..a64f02a6138 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java @@ -76,7 +76,7 @@ public double validate(double arg, SchemaConfiguration configuration) { } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java index c351ee8ea44..a3a1df15a66 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java @@ -70,7 +70,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java index 6881e4149f0..5347eca26e2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java @@ -62,7 +62,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java index 4851ae62d7a..5a9403dd7bf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java @@ -34,7 +34,7 @@ protected void throwIfKeyKnown(String key, Set requiredKeys, Set } @Override - public Set> entrySet() { + public @NonNull Set> entrySet() { return map.entrySet(); } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java index 1c580d45abe..c5f17c022ac 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java @@ -22,11 +22,10 @@ public Object getConstraint() { if (!(arg instanceof List)) { return null; } - List castArg = (List) arg; PathToSchemasMap pathToSchemas = new PathToSchemasMap(); // todo add handling for prefixItems int i = 0; - for(Object itemValue: castArg) { + for(Object itemValue: (List) arg) { List itemPathToItem = new ArrayList<>(validationMetadata.pathToItem()); itemPathToItem.add(i); ValidationMetadata itemValidationMetadata = new ValidationMetadata( diff --git a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs index d48f304bef0..df7d788b99b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs @@ -55,7 +55,7 @@ public class BooleanJsonSchema extends JsonSchema implements BooleanSchemaValida } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Boolean) { boolean boolArg = (Boolean) arg; return getNewInstance(boolArg, pathToItem, pathToSchemas); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs index dbc4bbb14af..5172c93c34a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs @@ -59,7 +59,7 @@ public class DateJsonSchema extends JsonSchema implements StringSchemaValidator } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs index 6e98002a69a..4ba67fbc498 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs @@ -62,7 +62,7 @@ public class DateTimeJsonSchema extends JsonSchema implements StringSchemaValida } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs index be3260f991c..70667187222 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs @@ -57,7 +57,7 @@ public class DecimalJsonSchema extends JsonSchema implements StringSchemaValidat } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs index 0c8f4dbb684..4409b6b1c31 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs @@ -61,7 +61,7 @@ public class DoubleJsonSchema extends JsonSchema implements NumberSchemaValidato } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs index 70cfcb74311..fabd570ba23 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs @@ -61,7 +61,7 @@ public class FloatJsonSchema extends JsonSchema implements NumberSchemaValidator } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs index 2f5c3b30595..f6dfe32c340 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs @@ -68,7 +68,7 @@ public class Int32JsonSchema extends JsonSchema implements NumberSchemaValidator } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs index 884afb5c3ab..0521c8989fd 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs @@ -78,7 +78,7 @@ public class Int64JsonSchema extends JsonSchema implements NumberSchemaValidator } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs index d56ada48e9e..366bb00daf1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs @@ -78,7 +78,7 @@ public class IntJsonSchema extends JsonSchema implements NumberSchemaValidator { } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs index edd99b9af4a..10698c35399 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs @@ -65,7 +65,7 @@ public class ListJsonSchema extends JsonSchema implements ListSchemaValidator pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs index 6886a2cc686..f5be1be99d7 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs @@ -65,7 +65,7 @@ public class MapJsonSchema extends JsonSchema implements MapSchemaValidator pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs index 6c1d2dd8a6d..1869774be03 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs @@ -55,7 +55,7 @@ public class NullJsonSchema extends JsonSchema implements NullSchemaValidator { } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg == null) { return getNewInstance((Void) null, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs index 5cffc21cea7..8916611de42 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs @@ -76,7 +76,7 @@ public class NumberJsonSchema extends JsonSchema implements NumberSchemaValidato } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Number) { return getNewInstance((Number) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs index a2d6aa75c58..e3a300d8520 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs @@ -70,7 +70,7 @@ public class StringJsonSchema extends JsonSchema implements StringSchemaValidato } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs index c436f9bb585..654032a74f9 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs @@ -62,7 +62,7 @@ public class UuidJsonSchema extends JsonSchema implements StringSchemaValidator } @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return getNewInstance((String) arg, pathToItem, pathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs index 8d86dcc0801..3c0371bd328 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs @@ -34,7 +34,7 @@ public class FrozenMap extends AbstractMap { } @Override - public Set> entrySet() { + public @NonNull Set> entrySet() { return map.entrySet(); } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs index aa63e0712cb..d6fc9884471 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs @@ -22,11 +22,10 @@ public class ItemsValidator implements KeywordValidator { if (!(arg instanceof List)) { return null; } - List castArg = (List) arg; PathToSchemasMap pathToSchemas = new PathToSchemasMap(); // todo add handling for prefixItems int i = 0; - for(Object itemValue: castArg) { + for(Object itemValue: (List) arg) { List itemPathToItem = new ArrayList<>(validationMetadata.pathToItem()); itemPathToItem.add(i); ValidationMetadata itemValidationMetadata = new ValidationMetadata( From 557b2015d4d5c65aba79b17b77823fe4960e00ae Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 13:48:06 -0800 Subject: [PATCH 12/52] Updates FrozenMap to fix type issues --- .../client/schemas/validation/FrozenMap.java | 9 +++++++-- .../java/packagename/schemas/validation/FrozenMap.hbs | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java index 5a9403dd7bf..6a253967eaa 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java @@ -1,5 +1,7 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.KeyFor; +import org.checkerframework.checker.nullness.qual.NonNull; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; @@ -7,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; public class FrozenMap extends AbstractMap { /* @@ -34,8 +37,10 @@ protected void throwIfKeyKnown(String key, Set requiredKeys, Set } @Override - public @NonNull Set> entrySet() { - return map.entrySet(); + public @NonNull Set> entrySet() { + return map.entrySet().stream() + .map(x -> new AbstractMap.SimpleEntry<>(x.getKey(), x.getValue())) + .collect(Collectors.toSet()); } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs index 3c0371bd328..311cfbfba59 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs @@ -1,5 +1,7 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.KeyFor; +import org.checkerframework.checker.nullness.qual.NonNull; import {{{packageName}}}.exceptions.UnsetPropertyException; import {{{packageName}}}.exceptions.InvalidAdditionalPropertyException; @@ -7,6 +9,7 @@ import java.util.AbstractMap; import java.util.HashMap; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; public class FrozenMap extends AbstractMap { /* @@ -34,8 +37,10 @@ public class FrozenMap extends AbstractMap { } @Override - public @NonNull Set> entrySet() { - return map.entrySet(); + public @NonNull Set> entrySet() { + return map.entrySet().stream() + .map(x -> new AbstractMap.SimpleEntry<>(x.getKey(), x.getValue())) + .collect(Collectors.toSet()); } } From a892b105d1d5b70471243382edd7840bf0e20340 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 14:03:59 -0800 Subject: [PATCH 13/52] Fixes type issues in ListJsonschema --- .../client/schemas/ListJsonSchema.java | 18 +++++++++++------- .../packagename/schemas/ListJsonSchema.hbs | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java index e6dd85e9028..ecb9e6f933d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java @@ -10,17 +10,17 @@ import org.openapijsonschematools.client.schemas.validation.ListSchemaValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Objects; import java.util.Set; -public class ListJsonSchema extends JsonSchema implements ListSchemaValidator> { +public class ListJsonSchema extends JsonSchema implements ListSchemaValidator> { private static @Nullable ListJsonSchema instance = null; protected ListJsonSchema() { @@ -37,14 +37,18 @@ public static ListJsonSchema getInstance() { } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } @@ -52,7 +56,7 @@ public FrozenList getNewInstance(List arg, List pathToItem, P } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs index 10698c35399..987e116a447 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs @@ -10,17 +10,17 @@ import {{{packageName}}}.schemas.validation.PathToSchemasMap; import {{{packageName}}}.schemas.validation.ListSchemaValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Objects; import java.util.Set; -public class ListJsonSchema extends JsonSchema implements ListSchemaValidator> { +public class ListJsonSchema extends JsonSchema implements ListSchemaValidator> { private static @Nullable ListJsonSchema instance = null; protected ListJsonSchema() { @@ -37,14 +37,18 @@ public class ListJsonSchema extends JsonSchema implements ListSchemaValidator getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } @@ -52,7 +56,7 @@ public class ListJsonSchema extends JsonSchema implements ListSchemaValidator validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); From 565c8c20d2e40f80840e224f2ee8bc03f01ce09e Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 14:33:28 -0800 Subject: [PATCH 14/52] Fixes MapJsonSchema --- .../client/schemas/MapJsonSchema.java | 24 ++++++++++++------ .../packagename/schemas/MapJsonSchema.hbs | 25 +++++++++++++------ 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index c9302eac3da..d4bc4272ff3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -22,7 +22,7 @@ import java.util.Objects; import java.util.Set; -public class MapJsonSchema extends JsonSchema implements MapSchemaValidator> { +public class MapJsonSchema extends JsonSchema implements MapSchemaValidator> { private static @Nullable MapJsonSchema instance = null; protected MapJsonSchema() { @@ -39,22 +39,32 @@ public static MapJsonSchema getInstance() { } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs index f5be1be99d7..62b02cde8ef 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs @@ -22,7 +22,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; -public class MapJsonSchema extends JsonSchema implements MapSchemaValidator> { +public class MapJsonSchema extends JsonSchema implements MapSchemaValidator> { private static @Nullable MapJsonSchema instance = null; protected MapJsonSchema() { @@ -39,22 +39,32 @@ public class MapJsonSchema extends JsonSchema implements MapSchemaValidator getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -72,3 +82,4 @@ public class MapJsonSchema extends JsonSchema implements MapSchemaValidator Date: Tue, 19 Dec 2023 14:48:20 -0800 Subject: [PATCH 15/52] Fixes type errors in AnyType/UnsetAnyType/NotAnyType schemas --- .../client/schemas/AnyTypeJsonSchema.java | 38 +++++++++++++------ .../client/schemas/MapJsonSchema.java | 1 + .../client/schemas/NotAnyTypeJsonSchema.java | 38 +++++++++++++------ .../validation/UnsetAnyTypeJsonSchema.java | 38 +++++++++++++------ .../packagename/schemas/AnyTypeJsonSchema.hbs | 38 +++++++++++++------ .../schemas/NotAnyTypeJsonSchema.hbs | 38 +++++++++++++------ .../validation/UnsetAnyTypeJsonSchema.hbs | 38 +++++++++++++------ 7 files changed, 157 insertions(+), 72 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index b39e63abd88..fd30e0b7f57 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -31,7 +31,7 @@ import java.util.Objects; import java.util.UUID; -public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { +public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable AnyTypeJsonSchema instance = null; protected AnyTypeJsonSchema() { @@ -126,14 +126,18 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } @@ -141,7 +145,7 @@ public FrozenList getNewInstance(List arg, List pathToItem, P } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -154,22 +158,32 @@ public FrozenList validate(List arg, SchemaConfiguration configu } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index d4bc4272ff3..7f4126d3ff4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -82,3 +82,4 @@ public static MapJsonSchema getInstance() { throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } + diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index 03e577d1909..cd54708643f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -31,7 +31,7 @@ import java.util.Objects; import java.util.UUID; -public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { +public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable NotAnyTypeJsonSchema instance = null; protected NotAnyTypeJsonSchema() { @@ -128,14 +128,18 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } @@ -143,7 +147,7 @@ public FrozenList getNewInstance(List arg, List pathToItem, P } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -156,22 +160,32 @@ public FrozenList validate(List arg, SchemaConfiguration configu } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index 022b9a14e60..f58829fd118 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -19,7 +19,7 @@ import java.util.Objects; import java.util.UUID; -public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { +public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable UnsetAnyTypeJsonSchema instance = null; protected UnsetAnyTypeJsonSchema() { @@ -114,14 +114,18 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } @@ -129,7 +133,7 @@ public FrozenList getNewInstance(List arg, List pathToItem, P } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -142,22 +146,32 @@ public FrozenList validate(List arg, SchemaConfiguration configu } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs index 9ff34c720de..6d67f7e6136 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs @@ -31,7 +31,7 @@ import java.util.Map; import java.util.Objects; import java.util.UUID; -public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { +public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable AnyTypeJsonSchema instance = null; protected AnyTypeJsonSchema() { @@ -126,14 +126,18 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } @@ -141,7 +145,7 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -154,22 +158,32 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs index 976801ddf2c..256ce047423 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs @@ -31,7 +31,7 @@ import java.util.Map; import java.util.Objects; import java.util.UUID; -public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { +public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable NotAnyTypeJsonSchema instance = null; protected NotAnyTypeJsonSchema() { @@ -128,14 +128,18 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } @@ -143,7 +147,7 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -156,22 +160,32 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs index 256272ee105..2ae68eefdca 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs @@ -19,7 +19,7 @@ import java.util.Map; import java.util.Objects; import java.util.UUID; -public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { +public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable UnsetAnyTypeJsonSchema instance = null; protected UnsetAnyTypeJsonSchema() { @@ -114,14 +114,18 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } @@ -129,7 +133,7 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -142,22 +146,32 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); From 18103603477c1717242d9c5aa6bc97daa6309895 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 14:57:42 -0800 Subject: [PATCH 16/52] Fixes type issue in RequiredValidator --- .../client/schemas/validation/RequiredValidator.java | 7 +++++-- .../packagename/schemas/validation/RequiredValidator.hbs | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java index 6d9f0361187..7ad2d28ae16 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java @@ -25,9 +25,12 @@ public Object getConstraint() { if (!(arg instanceof Map)) { return null; } - Map castArg = (Map) arg; Set missingRequiredProperties = new HashSet<>(required); - missingRequiredProperties.removeAll(castArg.keySet()); + for (Object key: ((Map) arg).keySet()) { + if (key instanceof String) { + missingRequiredProperties.remove(key); + } + } if (!missingRequiredProperties.isEmpty()) { List missingReqProps = missingRequiredProperties.stream().sorted().toList(); String pluralChar = ""; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs index 4cb44eda733..54cc417b9e3 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs @@ -25,9 +25,12 @@ public class RequiredValidator implements KeywordValidator { if (!(arg instanceof Map)) { return null; } - Map castArg = (Map) arg; Set missingRequiredProperties = new HashSet<>(required); - missingRequiredProperties.removeAll(castArg.keySet()); + for (Object key: ((Map) arg).keySet()) { + if (key instanceof String) { + missingRequiredProperties.remove(key); + } + } if (!missingRequiredProperties.isEmpty()) { List missingReqProps = missingRequiredProperties.stream().sorted().toList(); String pluralChar = ""; From 3a1e0e8a91d848e29950768c02a2a2b745a77edc Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 15:18:41 -0800 Subject: [PATCH 17/52] Fixes type issues in RequiredValidator --- .../validation/PropertiesValidator.java | 21 ++++++++++++------- .../validation/PropertiesValidator.hbs | 21 ++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java index e5e383d47c8..6d97b089b1e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java @@ -22,15 +22,22 @@ public Object getConstraint() { @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { - if (!(arg instanceof Map)) { + if (!(arg instanceof Map mapArg)) { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - Map castArg = (Map) arg; - Set presentProperties = new LinkedHashSet<>(castArg.keySet()); - presentProperties.retainAll(properties.keySet()); - for(String propName: presentProperties) { - Object propValue = castArg.get(propName); + Set presentProperties = new LinkedHashSet<>(); + for (Object key: mapArg.keySet()) { + if (key instanceof String) { + presentProperties.add((String) key); + } + } + for(Map.Entry> entry: properties.entrySet()) { + String propName = entry.getKey(); + if (!presentProperties.contains(propName)) { + continue; + } + @Nullable Object propValue = ((Map) arg).get(propName); List propPathToItem = new ArrayList<>(validationMetadata.pathToItem()); propPathToItem.add(propName); ValidationMetadata propValidationMetadata = new ValidationMetadata( @@ -39,7 +46,7 @@ public Object getConstraint() { validationMetadata.validatedPathToSchemas(), validationMetadata.seenClasses() ); - Class propClass = properties.get(propName); + Class propClass = entry.getValue(); JsonSchema propSchema = JsonSchemaFactory.getInstance(propClass); if (propValidationMetadata.validationRanEarlier(propSchema)) { // todo add_deeper_validated_schemas diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs index 63327083c58..b8a232ef349 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs @@ -22,15 +22,22 @@ public class PropertiesValidator implements KeywordValidator { @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { - if (!(arg instanceof Map)) { + if (!(arg instanceof Map mapArg)) { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - Map castArg = (Map) arg; - Set presentProperties = new LinkedHashSet<>(castArg.keySet()); - presentProperties.retainAll(properties.keySet()); - for(String propName: presentProperties) { - Object propValue = castArg.get(propName); + Set presentProperties = new LinkedHashSet<>(); + for (Object key: mapArg.keySet()) { + if (key instanceof String) { + presentProperties.add((String) key); + } + } + for(Map.Entry> entry: properties.entrySet()) { + String propName = entry.getKey(); + if (!presentProperties.contains(propName)) { + continue; + } + @Nullable Object propValue = ((Map) arg).get(propName); List propPathToItem = new ArrayList<>(validationMetadata.pathToItem()); propPathToItem.add(propName); ValidationMetadata propValidationMetadata = new ValidationMetadata( @@ -39,7 +46,7 @@ public class PropertiesValidator implements KeywordValidator { validationMetadata.validatedPathToSchemas(), validationMetadata.seenClasses() ); - Class propClass = properties.get(propName); + Class propClass = entry.getValue(); JsonSchema propSchema = JsonSchemaFactory.getInstance(propClass); if (propValidationMetadata.validationRanEarlier(propSchema)) { // todo add_deeper_validated_schemas From eb309ac8b4706b38a28d46dbaa199775f5960208 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 15:23:53 -0800 Subject: [PATCH 18/52] Removes getConstraint from validators --- .../schemas/validation/AdditionalPropertiesValidator.java | 5 ----- .../client/schemas/validation/AllOfValidator.java | 5 ----- .../client/schemas/validation/AnyOfValidator.java | 5 ----- .../client/schemas/validation/EnumValidator.java | 5 ----- .../client/schemas/validation/ExclusiveMaximumValidator.java | 5 ----- .../client/schemas/validation/ExclusiveMinimumValidator.java | 5 ----- .../client/schemas/validation/FakeValidator.java | 5 ----- .../client/schemas/validation/FormatValidator.java | 5 ----- .../client/schemas/validation/ItemsValidator.java | 5 ----- .../client/schemas/validation/KeywordValidator.java | 2 -- .../client/schemas/validation/MaxItemsValidator.java | 5 ----- .../client/schemas/validation/MaxLengthValidator.java | 5 ----- .../client/schemas/validation/MaxPropertiesValidator.java | 5 ----- .../client/schemas/validation/MaximumValidator.java | 5 ----- .../client/schemas/validation/MinItemsValidator.java | 5 ----- .../client/schemas/validation/MinLengthValidator.java | 5 ----- .../client/schemas/validation/MinPropertiesValidator.java | 5 ----- .../client/schemas/validation/MinimumValidator.java | 5 ----- .../client/schemas/validation/MultipleOfValidator.java | 5 ----- .../client/schemas/validation/NotValidator.java | 5 ----- .../client/schemas/validation/OneOfValidator.java | 5 ----- .../client/schemas/validation/PatternValidator.java | 5 ----- .../client/schemas/validation/PropertiesValidator.java | 5 ----- .../client/schemas/validation/RequiredValidator.java | 5 ----- .../client/schemas/validation/TypeValidator.java | 5 ----- .../client/schemas/validation/UniqueItemsValidator.java | 5 ----- .../schemas/validation/AdditionalPropertiesValidator.hbs | 5 ----- .../java/packagename/schemas/validation/AllOfValidator.hbs | 5 ----- .../java/packagename/schemas/validation/AnyOfValidator.hbs | 5 ----- .../java/packagename/schemas/validation/EnumValidator.hbs | 5 ----- .../schemas/validation/ExclusiveMaximumValidator.hbs | 5 ----- .../schemas/validation/ExclusiveMinimumValidator.hbs | 5 ----- .../java/packagename/schemas/validation/FakeValidator.hbs | 5 ----- .../java/packagename/schemas/validation/FormatValidator.hbs | 5 ----- .../java/packagename/schemas/validation/ItemsValidator.hbs | 5 ----- .../java/packagename/schemas/validation/KeywordValidator.hbs | 2 -- .../packagename/schemas/validation/MaxItemsValidator.hbs | 5 ----- .../packagename/schemas/validation/MaxLengthValidator.hbs | 5 ----- .../schemas/validation/MaxPropertiesValidator.hbs | 5 ----- .../java/packagename/schemas/validation/MaximumValidator.hbs | 5 ----- .../packagename/schemas/validation/MinItemsValidator.hbs | 5 ----- .../packagename/schemas/validation/MinLengthValidator.hbs | 5 ----- .../schemas/validation/MinPropertiesValidator.hbs | 5 ----- .../java/packagename/schemas/validation/MinimumValidator.hbs | 5 ----- .../packagename/schemas/validation/MultipleOfValidator.hbs | 5 ----- .../java/packagename/schemas/validation/NotValidator.hbs | 5 ----- .../java/packagename/schemas/validation/OneOfValidator.hbs | 5 ----- .../java/packagename/schemas/validation/PatternValidator.hbs | 5 ----- .../packagename/schemas/validation/PropertiesValidator.hbs | 5 ----- .../packagename/schemas/validation/RequiredValidator.hbs | 5 ----- .../java/packagename/schemas/validation/TypeValidator.hbs | 5 ----- .../packagename/schemas/validation/UniqueItemsValidator.hbs | 5 ----- 52 files changed, 254 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java index 6ed58a53a2f..211e5d4ed3a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java @@ -15,11 +15,6 @@ public AdditionalPropertiesValidator(Class additionalPrope this.additionalProperties = additionalProperties; } - @Override - public Object getConstraint() { - return additionalProperties; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java index 081b68fa0f9..7b392d027a7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java @@ -10,11 +10,6 @@ public AllOfValidator(List> allOf) { this.allOf = allOf; } - @Override - public Object getConstraint() { - return allOf; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java index c62853bf838..53d61e878b2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java @@ -13,11 +13,6 @@ public AnyOfValidator(List> anyOf) { this.anyOf = anyOf; } - @Override - public Object getConstraint() { - return anyOf; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java index 8165ae215cd..3b41cbed85f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java @@ -13,11 +13,6 @@ public EnumValidator(Set enumValues) { this.enumValues = enumValues; } - @Override - public Object getConstraint() { - return enumValues; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (enumValues.isEmpty()) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java index abd430e4135..6f07d0c46e7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMaximumValidator.java @@ -11,11 +11,6 @@ public ExclusiveMaximumValidator(Number exclusiveMaximum) { this.exclusiveMaximum = exclusiveMaximum; } - @Override - public Object getConstraint() { - return exclusiveMaximum; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java index 885368ec8d3..0bb892d6e54 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ExclusiveMinimumValidator.java @@ -11,11 +11,6 @@ public ExclusiveMinimumValidator(Number exclusiveMinimum) { this.exclusiveMinimum = exclusiveMinimum; } - @Override - public Object getConstraint() { - return exclusiveMinimum; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java index b23344a78f2..db5ec573081 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FakeValidator.java @@ -3,11 +3,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; public class FakeValidator implements KeywordValidator { - @Override - public Object getConstraint() { - return null; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { return null; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java index 7b36bcac5b9..2f165da7db2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FormatValidator.java @@ -15,11 +15,6 @@ public FormatValidator(String format) { this.format = format; } - @Override - public Object getConstraint() { - return format; - } - private final static BigInteger int32InclusiveMinimum = BigInteger.valueOf(-2147483648L); private final static BigInteger int32InclusiveMaximum = BigInteger.valueOf(2147483647L); private final static BigInteger int64InclusiveMinimum = BigInteger.valueOf(-9223372036854775808L); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java index c5f17c022ac..5d3bea9fc56 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java @@ -12,11 +12,6 @@ public ItemsValidator(Class items) { this.items = items; } - @Override - public Object getConstraint() { - return items; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java index b27aba5533d..42326a9beb3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/KeywordValidator.java @@ -8,6 +8,4 @@ public interface KeywordValidator { JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) throws ValidationException; - - Object getConstraint(); } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java index 437077dc57e..bc0e7a66932 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxItemsValidator.java @@ -12,11 +12,6 @@ public MaxItemsValidator(int maxItems) { this.maxItems = maxItems; } - @Override - public Object getConstraint() { - return maxItems; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java index aa9715308de..98986589f7b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxLengthValidator.java @@ -10,11 +10,6 @@ public MaxLengthValidator(int maxLength) { this.maxLength = maxLength; } - @Override - public Object getConstraint() { - return maxLength; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java index 9f06ed048c6..985cc631a12 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaxPropertiesValidator.java @@ -12,11 +12,6 @@ public MaxPropertiesValidator(int maxProperties) { this.maxProperties = maxProperties; } - @Override - public Object getConstraint() { - return maxProperties; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java index bfae8cd1856..77568666978 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MaximumValidator.java @@ -11,11 +11,6 @@ public MaximumValidator(Number maximum) { this.maximum = maximum; } - @Override - public Object getConstraint() { - return maximum; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java index 2d3dd39cb27..a9748b11707 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinItemsValidator.java @@ -12,11 +12,6 @@ public MinItemsValidator(int minItems) { this.minItems = minItems; } - @Override - public Object getConstraint() { - return minItems; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java index a5d30be2edf..2d23fc896c0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinLengthValidator.java @@ -10,11 +10,6 @@ public MinLengthValidator(int minLength) { this.minLength = minLength; } - @Override - public Object getConstraint() { - return minLength; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java index a72541422dc..8801e1872ef 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinPropertiesValidator.java @@ -12,11 +12,6 @@ public MinPropertiesValidator(int minProperties) { this.minProperties = minProperties; } - @Override - public Object getConstraint() { - return minProperties; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java index 8fe8aee5e49..f8e9b86e1d3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MinimumValidator.java @@ -11,11 +11,6 @@ public MinimumValidator(Number minimum) { this.minimum = minimum; } - @Override - public Object getConstraint() { - return minimum; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java index c33c8e85757..ce3c8887c2d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/MultipleOfValidator.java @@ -12,11 +12,6 @@ public MultipleOfValidator(BigDecimal multipleOf) { this.multipleOf = multipleOf; } - @Override - public Object getConstraint() { - return multipleOf; - } - private BigDecimal getBigDecimal(Number arg) { if (arg instanceof Integer) { return new BigDecimal((Integer) arg); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java index 1df78a0a217..34410cf0de0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java @@ -17,11 +17,6 @@ public NotValidator(Class not) { this.not = not; } - @Override - public Object getConstraint() { - return not; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java index 899742552e7..5d33ed1fefb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java @@ -13,11 +13,6 @@ public OneOfValidator(List> oneOf) { this.oneOf = oneOf; } - @Override - public Object getConstraint() { - return oneOf; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java index d5fc882f2a7..a16b14f73d3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PatternValidator.java @@ -12,11 +12,6 @@ public PatternValidator(Pattern pattern) { this.pattern = pattern; } - @Override - public Object getConstraint() { - return pattern; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java index 6d97b089b1e..ebfe8487bc8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java @@ -15,11 +15,6 @@ public PropertiesValidator(Map> properties) this.properties = properties; } - @Override - public Object getConstraint() { - return properties; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map mapArg)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java index 7ad2d28ae16..6f625049000 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/RequiredValidator.java @@ -15,11 +15,6 @@ public RequiredValidator(Set required) { this.required = required; } - @Override - public Object getConstraint() { - return required; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java index 5e4c73da2c6..a3028cae2db 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator.java @@ -14,11 +14,6 @@ public TypeValidator(Set> type) { this.type = type; } - @Override - public Object getConstraint() { - return type; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { Class argClass; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java index 67540b42a8f..b073cac6640 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java @@ -14,11 +14,6 @@ public UniqueItemsValidator(boolean uniqueItems) { this.uniqueItems = uniqueItems; } - @Override - public Object getConstraint() { - return uniqueItems; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs index 00eedd6b1fd..82d84225033 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs @@ -15,11 +15,6 @@ public class AdditionalPropertiesValidator implements KeywordValidator { this.additionalProperties = additionalProperties; } - @Override - public Object getConstraint() { - return additionalProperties; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs index d5b1bf6ac28..1265988112d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs @@ -10,11 +10,6 @@ public class AllOfValidator implements KeywordValidator { this.allOf = allOf; } - @Override - public Object getConstraint() { - return allOf; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs index 4a2cb5b1128..34cfb02095e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs @@ -13,11 +13,6 @@ public class AnyOfValidator implements KeywordValidator { this.anyOf = anyOf; } - @Override - public Object getConstraint() { - return anyOf; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs index 2ae8c177a9d..077a385bcf4 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs @@ -13,11 +13,6 @@ public class EnumValidator implements KeywordValidator { this.enumValues = enumValues; } - @Override - public Object getConstraint() { - return enumValues; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (enumValues.isEmpty()) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs index 78249e04b2f..3e22c7284a6 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMaximumValidator.hbs @@ -11,11 +11,6 @@ public class ExclusiveMaximumValidator implements KeywordValidator { this.exclusiveMaximum = exclusiveMaximum; } - @Override - public Object getConstraint() { - return exclusiveMaximum; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs index beef0da5385..aed9d726981 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ExclusiveMinimumValidator.hbs @@ -11,11 +11,6 @@ public class ExclusiveMinimumValidator implements KeywordValidator { this.exclusiveMinimum = exclusiveMinimum; } - @Override - public Object getConstraint() { - return exclusiveMinimum; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs index d3795c4f51c..2418e8a3552 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/FakeValidator.hbs @@ -3,11 +3,6 @@ package {{{packageName}}}.schemas.validation; import org.checkerframework.checker.nullness.qual.Nullable; public class FakeValidator implements KeywordValidator { - @Override - public Object getConstraint() { - return null; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { return null; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs index 5c6995866fd..315235efcc1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/FormatValidator.hbs @@ -15,11 +15,6 @@ public class FormatValidator implements KeywordValidator { this.format = format; } - @Override - public Object getConstraint() { - return format; - } - private final static BigInteger int32InclusiveMinimum = BigInteger.valueOf(-2147483648L); private final static BigInteger int32InclusiveMaximum = BigInteger.valueOf(2147483647L); private final static BigInteger int64InclusiveMinimum = BigInteger.valueOf(-9223372036854775808L); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs index d6fc9884471..8ca2f6b7834 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs @@ -12,11 +12,6 @@ public class ItemsValidator implements KeywordValidator { this.items = items; } - @Override - public Object getConstraint() { - return items; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs index 2da5a78122d..4c7352bc3ab 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/KeywordValidator.hbs @@ -8,6 +8,4 @@ public interface KeywordValidator { JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) throws ValidationException; - - Object getConstraint(); } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs index 3a65b75292a..ed08a4e64f7 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxItemsValidator.hbs @@ -12,11 +12,6 @@ public class MaxItemsValidator implements KeywordValidator { this.maxItems = maxItems; } - @Override - public Object getConstraint() { - return maxItems; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs index 1f271b64b8b..22d2ad9dc0e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxLengthValidator.hbs @@ -10,11 +10,6 @@ public class MaxLengthValidator extends LengthValidator implements KeywordValida this.maxLength = maxLength; } - @Override - public Object getConstraint() { - return maxLength; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs index e0217a69929..2ada73c7893 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaxPropertiesValidator.hbs @@ -12,11 +12,6 @@ public class MaxPropertiesValidator implements KeywordValidator { this.maxProperties = maxProperties; } - @Override - public Object getConstraint() { - return maxProperties; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs index b2a8e273c6e..7730c282c3e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MaximumValidator.hbs @@ -11,11 +11,6 @@ public class MaximumValidator implements KeywordValidator { this.maximum = maximum; } - @Override - public Object getConstraint() { - return maximum; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs index 4e5cb6b1263..90e247bd943 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinItemsValidator.hbs @@ -12,11 +12,6 @@ public class MinItemsValidator implements KeywordValidator { this.minItems = minItems; } - @Override - public Object getConstraint() { - return minItems; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs index 6fc8054a9e1..8197813a52a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinLengthValidator.hbs @@ -10,11 +10,6 @@ public class MinLengthValidator extends LengthValidator implements KeywordValida this.minLength = minLength; } - @Override - public Object getConstraint() { - return minLength; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs index 39ae246f835..f8d63210f8d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinPropertiesValidator.hbs @@ -12,11 +12,6 @@ public class MinPropertiesValidator implements KeywordValidator { this.minProperties = minProperties; } - @Override - public Object getConstraint() { - return minProperties; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs index 3a4eeed49bf..0153a3b9cff 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MinimumValidator.hbs @@ -11,11 +11,6 @@ public class MinimumValidator implements KeywordValidator { this.minimum = minimum; } - @Override - public Object getConstraint() { - return minimum; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Number)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs index 016bfa5bb3e..9142d9ebc34 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/MultipleOfValidator.hbs @@ -12,11 +12,6 @@ public class MultipleOfValidator implements KeywordValidator { this.multipleOf = multipleOf; } - @Override - public Object getConstraint() { - return multipleOf; - } - private BigDecimal getBigDecimal(Number arg) { if (arg instanceof Integer) { return new BigDecimal((Integer) arg); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs index 50ba2040114..5eb143982a7 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs @@ -17,11 +17,6 @@ public class NotValidator implements KeywordValidator { this.not = not; } - @Override - public Object getConstraint() { - return not; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs index 0d2d784f1f4..f2d71311cb9 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs @@ -13,11 +13,6 @@ public class OneOfValidator implements KeywordValidator { this.oneOf = oneOf; } - @Override - public Object getConstraint() { - return oneOf; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { PathToSchemasMap pathToSchemas = new PathToSchemasMap(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs index b4193198b61..6f4bd5053c1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PatternValidator.hbs @@ -12,11 +12,6 @@ public class PatternValidator implements KeywordValidator { this.pattern = pattern; } - @Override - public Object getConstraint() { - return pattern; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof String)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs index b8a232ef349..065c3c30eb1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs @@ -15,11 +15,6 @@ public class PropertiesValidator implements KeywordValidator { this.properties = properties; } - @Override - public Object getConstraint() { - return properties; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map mapArg)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs index 54cc417b9e3..7c9a0b72b16 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/RequiredValidator.hbs @@ -15,11 +15,6 @@ public class RequiredValidator implements KeywordValidator { this.required = required; } - @Override - public Object getConstraint() { - return required; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof Map)) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs index 31701e92a85..3fc3dd6717b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/TypeValidator.hbs @@ -14,11 +14,6 @@ public class TypeValidator implements KeywordValidator { this.type = type; } - @Override - public Object getConstraint() { - return type; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { Class argClass; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs index bbf4841568d..c27a68e5b2b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs @@ -14,11 +14,6 @@ public class UniqueItemsValidator implements KeywordValidator { this.uniqueItems = uniqueItems; } - @Override - public Object getConstraint() { - return uniqueItems; - } - @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (!(arg instanceof List)) { From e18987c69b72f12652fa0b393025cea6bf9fa425 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 16:10:55 -0800 Subject: [PATCH 19/52] Updates EnumValidator --- .../client/schemas/validation/EnumValidator.java | 4 ++-- .../client/schemas/validation/JsonSchema.java | 2 +- .../client/schemas/validation/JsonSchemaInfo.java | 4 ++-- .../java/packagename/schemas/validation/EnumValidator.hbs | 4 ++-- .../main/java/packagename/schemas/validation/JsonSchema.hbs | 2 +- .../java/packagename/schemas/validation/JsonSchemaInfo.hbs | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java index 3b41cbed85f..85a109f2a01 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java @@ -7,9 +7,9 @@ import java.util.Set; public class EnumValidator implements KeywordValidator { - public final Set enumValues; + public final Set<@Nullable Object> enumValues; - public EnumValidator(Set enumValues) { + public EnumValidator(Set<@Nullable Object> enumValues) { this.enumValues = enumValues; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 8b9720f8634..806e47275b6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -40,7 +40,7 @@ public abstract class JsonSchema { public final @Nullable List> oneOf; public final @Nullable Class not; public final @Nullable Boolean uniqueItems; - public final @Nullable Set enumValues; + public final @Nullable Set<@Nullable Object> enumValues; public final @Nullable Pattern pattern; private final @NonNull LinkedHashMap keywordToValidator; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java index c1b76107a80..cb6e84cb8d1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java @@ -119,8 +119,8 @@ public JsonSchemaInfo uniqueItems(@NonNull Boolean uniqueItems) { this.uniqueItems = uniqueItems; return this; } - public @Nullable Set enumValues = null; - public JsonSchemaInfo enumValues(@NonNull Set enumValues) { + public @Nullable Set<@Nullable Object> enumValues = null; + public JsonSchemaInfo enumValues(@NonNull Set<@Nullable Object> enumValues) { this.enumValues = enumValues; return this; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs index 077a385bcf4..bde744bf93b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs @@ -7,9 +7,9 @@ import java.math.BigDecimal; import java.util.Set; public class EnumValidator implements KeywordValidator { - public final Set enumValues; + public final Set<@Nullable Object> enumValues; - public EnumValidator(Set enumValues) { + public EnumValidator(Set<@Nullable Object> enumValues) { this.enumValues = enumValues; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index 9afa445cd3f..c4e8d5dc2d7 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -40,7 +40,7 @@ public abstract class JsonSchema { public final @Nullable List> oneOf; public final @Nullable Class not; public final @Nullable Boolean uniqueItems; - public final @Nullable Set enumValues; + public final @Nullable Set<@Nullable Object> enumValues; public final @Nullable Pattern pattern; private final @NonNull LinkedHashMap keywordToValidator; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs index ad8d1f4d33b..505c805e4cc 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs @@ -119,8 +119,8 @@ public class JsonSchemaInfo { this.uniqueItems = uniqueItems; return this; } - public @Nullable Set enumValues = null; - public JsonSchemaInfo enumValues(@NonNull Set enumValues) { + public @Nullable Set<@Nullable Object> enumValues = null; + public JsonSchemaInfo enumValues(@NonNull Set<@Nullable Object> enumValues) { this.enumValues = enumValues; return this; } From 88cc1d44a1a7bc85a017a6419886a4d97c559f1e Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 16:17:51 -0800 Subject: [PATCH 20/52] Updates UniqueItemsValidator --- .../client/schemas/validation/UniqueItemsValidator.java | 4 ++-- .../packagename/schemas/validation/UniqueItemsValidator.hbs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java index b073cac6640..8b443cc9b29 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java @@ -22,8 +22,8 @@ public UniqueItemsValidator(boolean uniqueItems) { if (!uniqueItems) { return null; } - Set seenItems = new HashSet<>(); - for (Object item: (List) arg) { + Set<@Nullable Object> seenItems = new HashSet<>(); + for (@Nullable Object item: (List) arg) { int startingSeenItemsSize = seenItems.size(); seenItems.add(item); if (seenItems.size() == startingSeenItemsSize) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs index c27a68e5b2b..e556a59f816 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UniqueItemsValidator.hbs @@ -22,8 +22,8 @@ public class UniqueItemsValidator implements KeywordValidator { if (!uniqueItems) { return null; } - Set seenItems = new HashSet<>(); - for (Object item: (List) arg) { + Set<@Nullable Object> seenItems = new HashSet<>(); + for (@Nullable Object item: (List) arg) { int startingSeenItemsSize = seenItems.size(); seenItems.add(item); if (seenItems.size() == startingSeenItemsSize) { From 5b3b5f87309dbb858b4ed686d6972c0b778503c7 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 16:58:43 -0800 Subject: [PATCH 21/52] Fixes EnumValidator by supressing the nullness check on set.contains --- .../client/schemas/validation/EnumValidator.java | 7 ++++++- .../java/packagename/schemas/validation/EnumValidator.hbs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java index 85a109f2a01..18bf8d346e8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/EnumValidator.java @@ -13,12 +13,17 @@ public EnumValidator(Set<@Nullable Object> enumValues) { this.enumValues = enumValues; } + @SuppressWarnings("nullness") + private boolean enumContainsArg(@Nullable Object arg){ + return enumValues.contains(arg); + } + @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (enumValues.isEmpty()) { throw new ValidationException("No value can match enum because enum is empty"); } - if (enumValues.contains(arg)) { + if (enumContainsArg(arg)) { return null; } if (arg instanceof Float) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs index bde744bf93b..66f935c79ab 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/EnumValidator.hbs @@ -13,12 +13,17 @@ public class EnumValidator implements KeywordValidator { this.enumValues = enumValues; } + @SuppressWarnings("nullness") + private boolean enumContainsArg(@Nullable Object arg){ + return enumValues.contains(arg); + } + @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { if (enumValues.isEmpty()) { throw new ValidationException("No value can match enum because enum is empty"); } - if (enumValues.contains(arg)) { + if (enumContainsArg(arg)) { return null; } if (arg instanceof Float) { From bc6268dfb8a8520cc626b422838b9e334737fec1 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 17:07:55 -0800 Subject: [PATCH 22/52] Fixes AdditionalPropertiesValidator --- .../validation/AdditionalPropertiesValidator.java | 13 ++++++++----- .../validation/AdditionalPropertiesValidator.hbs | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java index 211e5d4ed3a..5a5a6cfc917 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java @@ -2,7 +2,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; -import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -17,18 +16,22 @@ public AdditionalPropertiesValidator(Class additionalPrope @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { - if (!(arg instanceof Map)) { + if (!(arg instanceof Map mapArg)) { return null; } - Map castArg = (Map) arg; - Set presentAdditionalProperties = new LinkedHashSet<>(castArg.keySet()); + Set presentAdditionalProperties = new LinkedHashSet<>(); + for (Object key: mapArg.keySet()) { + if (key instanceof String) { + presentAdditionalProperties.add((String) key); + } + } if (schema.properties != null) { presentAdditionalProperties.removeAll(schema.properties.keySet()); } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); // todo add handling for validatedPatternProperties for(String addPropName: presentAdditionalProperties) { - Object propValue = castArg.get(addPropName); + @Nullable Object propValue = mapArg.get(addPropName); List propPathToItem = new ArrayList<>(validationMetadata.pathToItem()); propPathToItem.add(addPropName); ValidationMetadata propValidationMetadata = new ValidationMetadata( diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs index 82d84225033..fb251d07c73 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs @@ -2,7 +2,6 @@ package {{{packageName}}}.schemas.validation; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; -import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -17,18 +16,22 @@ public class AdditionalPropertiesValidator implements KeywordValidator { @Override public @Nullable PathToSchemasMap validate(JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata) { - if (!(arg instanceof Map)) { + if (!(arg instanceof Map mapArg)) { return null; } - Map castArg = (Map) arg; - Set presentAdditionalProperties = new LinkedHashSet<>(castArg.keySet()); + Set presentAdditionalProperties = new LinkedHashSet<>(); + for (Object key: mapArg.keySet()) { + if (key instanceof String) { + presentAdditionalProperties.add((String) key); + } + } if (schema.properties != null) { presentAdditionalProperties.removeAll(schema.properties.keySet()); } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); // todo add handling for validatedPatternProperties for(String addPropName: presentAdditionalProperties) { - Object propValue = castArg.get(addPropName); + @Nullable Object propValue = mapArg.get(addPropName); List propPathToItem = new ArrayList<>(validationMetadata.pathToItem()); propPathToItem.add(addPropName); ValidationMetadata propValidationMetadata = new ValidationMetadata( From c00abf3046fa20ec5dafb11f367813e94f2fb034 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 18:14:47 -0800 Subject: [PATCH 23/52] Fixes JsonSchemaFactory --- .../schemas/validation/JsonSchemaFactory.java | 13 ++++++++++--- .../schemas/validation/JsonSchemaFactory.hbs | 12 +++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java index b3eaf9228eb..4e9b537b1ae 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java @@ -1,5 +1,8 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; @@ -10,12 +13,16 @@ public class JsonSchemaFactory { static Map, JsonSchema> classToInstance = new HashMap<>(); public static V getInstance(Class schemaCls) { - if (classToInstance.containsKey(schemaCls)) { - return (V) classToInstance.get(schemaCls); + @Nullable JsonSchema cacheInst = classToInstance.get(schemaCls); + if (cacheInst != null) { + assert schemaCls.isInstance(cacheInst); + return schemaCls.cast(cacheInst); } try { Method method = schemaCls.getMethod("getInstance"); - V inst = (V) method.invoke(null); + @SuppressWarnings("nullness") @NonNull Object obj = method.invoke(null); + assert schemaCls.isInstance(obj); + @NonNull V inst = schemaCls.cast(obj); classToInstance.put(schemaCls, inst); return inst; } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs index 0402a8408a5..d3dffd660f4 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs @@ -1,5 +1,7 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; + import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; @@ -10,12 +12,16 @@ public class JsonSchemaFactory { static Map, JsonSchema> classToInstance = new HashMap<>(); public static V getInstance(Class schemaCls) { - if (classToInstance.containsKey(schemaCls)) { - return (V) classToInstance.get(schemaCls); + @Nullable JsonSchema cacheInst = classToInstance.get(schemaCls); + if (cacheInst != null) { + assert schemaCls.isInstance(cacheInst); + return schemaCls.cast(cacheInst); } try { Method method = schemaCls.getMethod("getInstance"); - V inst = (V) method.invoke(null); + @SuppressWarnings("nullness") @NonNull Object obj = method.invoke(null); + assert schemaCls.isInstance(obj); + @NonNull V inst = schemaCls.cast(obj); classToInstance.put(schemaCls, inst); return inst; } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { From 6d1b383d4f6e95ca1154755e8d19b0cef0b94a39 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 18:43:06 -0800 Subject: [PATCH 24/52] Fixes getNewInstance for custom list schemas --- ...ditionalpropertiesAreAllowedByDefault.java | 18 +++-- ...lpropertiesShouldNotLookInApplicators.java | 36 ++++++---- .../client/components/schemas/Allof.java | 54 ++++++++------ .../schemas/AllofCombinedWithAnyofOneof.java | 72 +++++++++++-------- .../components/schemas/AllofSimpleTypes.java | 54 ++++++++------ .../schemas/AllofWithBaseSchema.java | 54 ++++++++------ .../schemas/AllofWithOneEmptySchema.java | 18 +++-- .../schemas/AllofWithTheFirstEmptySchema.java | 18 +++-- .../schemas/AllofWithTheLastEmptySchema.java | 18 +++-- .../schemas/AllofWithTwoEmptySchemas.java | 18 +++-- .../client/components/schemas/Anyof.java | 36 ++++++---- .../components/schemas/AnyofComplexTypes.java | 54 ++++++++------ .../schemas/AnyofWithBaseSchema.java | 36 ++++++---- .../schemas/AnyofWithOneEmptySchema.java | 18 +++-- .../schemas/ArrayTypeMatchesArrays.java | 6 +- .../client/components/schemas/ByInt.java | 18 +++-- .../client/components/schemas/ByNumber.java | 18 +++-- .../components/schemas/BySmallNumber.java | 18 +++-- .../components/schemas/DateTimeFormat.java | 18 +++-- .../components/schemas/EmailFormat.java | 18 +++-- .../components/schemas/ForbiddenProperty.java | 18 +++-- .../components/schemas/HostnameFormat.java | 18 +++-- .../schemas/InvalidStringValueForDefault.java | 18 +++-- .../client/components/schemas/Ipv4Format.java | 18 +++-- .../client/components/schemas/Ipv6Format.java | 18 +++-- .../components/schemas/JsonPointerFormat.java | 18 +++-- .../components/schemas/MaximumValidation.java | 18 +++-- .../MaximumValidationWithUnsignedInteger.java | 18 +++-- .../schemas/MaxitemsValidation.java | 18 +++-- .../schemas/MaxlengthValidation.java | 18 +++-- .../Maxproperties0MeansTheObjectIsEmpty.java | 18 +++-- .../schemas/MaxpropertiesValidation.java | 18 +++-- .../components/schemas/MinimumValidation.java | 18 +++-- .../MinimumValidationWithSignedInteger.java | 18 +++-- .../schemas/MinitemsValidation.java | 18 +++-- .../schemas/MinlengthValidation.java | 18 +++-- .../schemas/MinpropertiesValidation.java | 18 +++-- ...NestedAllofToCheckValidationSemantics.java | 36 ++++++---- ...NestedAnyofToCheckValidationSemantics.java | 36 ++++++---- .../components/schemas/NestedItems.java | 24 +++++-- ...NestedOneofToCheckValidationSemantics.java | 36 ++++++---- .../client/components/schemas/Not.java | 18 +++-- .../schemas/NotMoreComplexSchema.java | 18 +++-- .../schemas/ObjectPropertiesValidation.java | 18 +++-- .../client/components/schemas/Oneof.java | 36 ++++++---- .../components/schemas/OneofComplexTypes.java | 54 ++++++++------ .../schemas/OneofWithBaseSchema.java | 36 ++++++---- .../schemas/OneofWithEmptySchema.java | 18 +++-- .../components/schemas/OneofWithRequired.java | 36 ++++++---- .../schemas/PatternIsNotAnchored.java | 18 +++-- .../components/schemas/PatternValidation.java | 18 +++-- .../PropertiesWithEscapedCharacters.java | 18 +++-- .../PropertyNamedRefThatIsNotAReference.java | 18 +++-- .../client/components/schemas/RefInAllof.java | 18 +++-- .../client/components/schemas/RefInAnyof.java | 18 +++-- .../client/components/schemas/RefInItems.java | 6 +- .../client/components/schemas/RefInNot.java | 18 +++-- .../client/components/schemas/RefInOneof.java | 18 +++-- .../components/schemas/RefInProperty.java | 18 +++-- .../schemas/RequiredDefaultValidation.java | 18 +++-- .../schemas/RequiredValidation.java | 18 +++-- .../schemas/RequiredWithEmptyArray.java | 18 +++-- .../RequiredWithEscapedCharacters.java | 18 +++-- .../schemas/UniqueitemsFalseValidation.java | 18 +++-- .../schemas/UniqueitemsValidation.java | 18 +++-- .../client/components/schemas/UriFormat.java | 18 +++-- .../schemas/UriReferenceFormat.java | 18 +++-- .../components/schemas/UriTemplateFormat.java | 18 +++-- .../_Schema_anytypeOrMultitype.hbs | 4 +- .../SchemaClass/_validate_implementor.hbs | 32 +++++---- .../schemas/validation/JsonSchemaFactory.hbs | 1 + 71 files changed, 1010 insertions(+), 629 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index d3f7e36d46a..f8887415c5c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -77,7 +77,7 @@ public static class AdditionalpropertiesAreAllowedByDefaultMapInput { } - public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -183,23 +183,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index 34fc4dcbf2d..db0c8288dfc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -71,7 +71,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -170,23 +170,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -265,7 +269,7 @@ public static class AdditionalpropertiesShouldNotLookInApplicatorsMapInput { } - public static class AdditionalpropertiesShouldNotLookInApplicators1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class AdditionalpropertiesShouldNotLookInApplicators1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -371,23 +375,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 02179fe53c1..beacc6798c8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -66,7 +66,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -168,23 +168,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -273,7 +277,7 @@ public static class Schema1MapInput { } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -375,23 +379,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -450,7 +458,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class Allof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Allof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -556,23 +564,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index 34fce5223af..4c4e8bf0a01 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -34,7 +34,7 @@ public class AllofCombinedWithAnyofOneof { // nest classes so all schemas and input/output classes can be public - public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema02 instance = null; protected Schema02() { @@ -131,23 +131,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -206,7 +210,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -303,23 +307,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -378,7 +386,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -475,23 +483,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -550,7 +562,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -661,23 +673,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index f9b6e4cfc0b..33c1ac742ba 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -33,7 +33,7 @@ public class AllofSimpleTypes { // nest classes so all schemas and input/output classes can be public - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -130,23 +130,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -205,7 +209,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -302,23 +306,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -377,7 +385,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -483,23 +491,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index ff231dba317..0ae95294ed9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -67,7 +67,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -169,23 +169,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -274,7 +278,7 @@ public static class Schema1MapInput { } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -376,23 +380,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -481,7 +489,7 @@ public static class AllofWithBaseSchemaMapInput { } - public static class AllofWithBaseSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class AllofWithBaseSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -593,23 +601,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index b1de1f8ddbd..a0ef514aa15 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -37,7 +37,7 @@ public class AllofWithOneEmptySchema { public static class Schema0 extends AnyTypeJsonSchema {} - public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -142,23 +142,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index f7dc5307c26..f461bb2e7a9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -41,7 +41,7 @@ public static class Schema0 extends AnyTypeJsonSchema {} public static class Schema1 extends NumberJsonSchema {} - public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -147,23 +147,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 3b72be12d90..66cced7eaf9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -41,7 +41,7 @@ public static class Schema0 extends NumberJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -147,23 +147,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index 3501e1a9740..bb202812a10 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -40,7 +40,7 @@ public static class Schema0 extends AnyTypeJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -146,23 +146,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index c3b9e9ea0d8..28941d1c857 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -37,7 +37,7 @@ public class Anyof { public static class Schema0 extends IntJsonSchema {} - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -134,23 +134,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -209,7 +213,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Anyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Anyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -315,23 +319,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index cbec5075bc6..e38caffe10c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -66,7 +66,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -168,23 +168,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -273,7 +277,7 @@ public static class Schema1MapInput { } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -375,23 +379,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -450,7 +458,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -556,23 +564,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index 5c2c8351c5d..f906c8982b7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -33,7 +33,7 @@ public class AnyofWithBaseSchema { // nest classes so all schemas and input/output classes can be public - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -130,23 +130,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -205,7 +209,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -302,23 +306,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index b41831ca24d..fee7548c198 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -41,7 +41,7 @@ public static class Schema0 extends NumberJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -147,23 +147,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java index 146c7582906..c0ef9f311ee 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java @@ -72,7 +72,11 @@ public ArrayTypeMatchesArraysList getNewInstance(List arg, List pathT for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 4464bc3d5c6..3eb8211cd7f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -34,7 +34,7 @@ public class ByInt { // nest classes so all schemas and input/output classes can be public - public static class ByInt1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class ByInt1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -137,23 +137,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index ccd8ccc1014..41a179fc9e2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -34,7 +34,7 @@ public class ByNumber { // nest classes so all schemas and input/output classes can be public - public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -137,23 +137,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index 09741744625..64dac8ef2bd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -34,7 +34,7 @@ public class BySmallNumber { // nest classes so all schemas and input/output classes can be public - public static class BySmallNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class BySmallNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -137,23 +137,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 457a7efc786..cd783715df9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -33,7 +33,7 @@ public class DateTimeFormat { // nest classes so all schemas and input/output classes can be public - public static class DateTimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class DateTimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index 77907c8a5de..902c7d77d73 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -33,7 +33,7 @@ public class EmailFormat { // nest classes so all schemas and input/output classes can be public - public static class EmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class EmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 6730e5bd14d..04c5b9f7280 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -69,7 +69,7 @@ public static class ForbiddenPropertyMapInput { } - public static class ForbiddenProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class ForbiddenProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -174,23 +174,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index b6efe77fe52..a16804026f7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -33,7 +33,7 @@ public class HostnameFormat { // nest classes so all schemas and input/output classes can be public - public static class HostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class HostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 0aa8b5bcf18..7e13b6a0dee 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -102,7 +102,7 @@ public static class InvalidStringValueForDefaultMapInput { } - public static class InvalidStringValueForDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class InvalidStringValueForDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -207,23 +207,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index 48f4f1ff2ca..c27eb428fb5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -33,7 +33,7 @@ public class Ipv4Format { // nest classes so all schemas and input/output classes can be public - public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index ddc79482063..7e64360f711 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -33,7 +33,7 @@ public class Ipv6Format { // nest classes so all schemas and input/output classes can be public - public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 203287cb637..d8e3410c39e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -33,7 +33,7 @@ public class JsonPointerFormat { // nest classes so all schemas and input/output classes can be public - public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 3119087aa8b..a4298cf64b0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -33,7 +33,7 @@ public class MaximumValidation { // nest classes so all schemas and input/output classes can be public - public static class MaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index e118cb495f7..00ba25a8970 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -33,7 +33,7 @@ public class MaximumValidationWithUnsignedInteger { // nest classes so all schemas and input/output classes can be public - public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index 29cb0dd90fb..a7dea0dd76e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -33,7 +33,7 @@ public class MaxitemsValidation { // nest classes so all schemas and input/output classes can be public - public static class MaxitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaxitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 919b562302d..5cfaa46fb7d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -33,7 +33,7 @@ public class MaxlengthValidation { // nest classes so all schemas and input/output classes can be public - public static class MaxlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaxlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index e4c6080e4bb..971e502ca7e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -33,7 +33,7 @@ public class Maxproperties0MeansTheObjectIsEmpty { // nest classes so all schemas and input/output classes can be public - public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index b91bc36e676..aeb678be750 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -33,7 +33,7 @@ public class MaxpropertiesValidation { // nest classes so all schemas and input/output classes can be public - public static class MaxpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaxpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index 848b5bd85cf..ec9b08fbd23 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -33,7 +33,7 @@ public class MinimumValidation { // nest classes so all schemas and input/output classes can be public - public static class MinimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index 218e48b13e8..b544a895c24 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -33,7 +33,7 @@ public class MinimumValidationWithSignedInteger { // nest classes so all schemas and input/output classes can be public - public static class MinimumValidationWithSignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinimumValidationWithSignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index 4d71b78c471..4d79e0a97ea 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -33,7 +33,7 @@ public class MinitemsValidation { // nest classes so all schemas and input/output classes can be public - public static class MinitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 0ef62c308b4..ea561277077 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -33,7 +33,7 @@ public class MinlengthValidation { // nest classes so all schemas and input/output classes can be public - public static class MinlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index 377fde35cb6..cb022deda31 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -33,7 +33,7 @@ public class MinpropertiesValidation { // nest classes so all schemas and input/output classes can be public - public static class MinpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 89bb85d9d2c..7080e9a6711 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -37,7 +37,7 @@ public class NestedAllofToCheckValidationSemantics { public static class Schema01 extends NullJsonSchema {} - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -211,7 +215,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -316,23 +320,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index 973250eaa96..85d1b687c36 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -37,7 +37,7 @@ public class NestedAnyofToCheckValidationSemantics { public static class Schema01 extends NullJsonSchema {} - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -211,7 +215,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -316,23 +320,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index b27a4291f2b..620af47e4de 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -66,7 +66,11 @@ public ItemsList getNewInstance(List arg, List pathToItem, PathToSche for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); Number castItem = (Number) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -133,7 +137,11 @@ public ItemsList1 getNewInstance(List arg, List pathToItem, PathToSch for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); ItemsList castItem = (ItemsList) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -200,7 +208,11 @@ public ItemsList2 getNewInstance(List arg, List pathToItem, PathToSch for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); ItemsList1 castItem = (ItemsList1) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -273,7 +285,11 @@ public NestedItemsList getNewInstance(List arg, List pathToItem, Path for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); ItemsList2 castItem = (ItemsList2) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index 826fc8692d2..78dc4013ce4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -37,7 +37,7 @@ public class NestedOneofToCheckValidationSemantics { public static class Schema01 extends NullJsonSchema {} - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -211,7 +215,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -316,23 +320,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index 8b75c184853..fbf0b6aecf2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -37,7 +37,7 @@ public class Not { public static class Not2 extends IntJsonSchema {} - public static class Not1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Not1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -140,23 +140,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 593422ca570..2008c1a44fd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -123,7 +123,7 @@ public NotMap validate(Map arg, SchemaConfiguration configuratio } - public static class NotMoreComplexSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NotMoreComplexSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -226,23 +226,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index 8bc4d038a9a..c84d3c2f2b7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -78,7 +78,7 @@ public static class ObjectPropertiesValidationMapInput { } - public static class ObjectPropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class ObjectPropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -184,23 +184,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index 7a6e1fd0be6..c144816174c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -37,7 +37,7 @@ public class Oneof { public static class Schema0 extends IntJsonSchema {} - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -134,23 +134,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -209,7 +213,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Oneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Oneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -315,23 +319,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index ba1642ab4df..85818bff679 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -66,7 +66,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -168,23 +168,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -273,7 +277,7 @@ public static class Schema1MapInput { } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -375,23 +379,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -450,7 +458,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -556,23 +564,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index a3702fc06b3..aeb9d439958 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -33,7 +33,7 @@ public class OneofWithBaseSchema { // nest classes so all schemas and input/output classes can be public - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -130,23 +130,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -205,7 +209,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -302,23 +306,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 310fb2009a0..b32450e6865 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -41,7 +41,7 @@ public static class Schema0 extends NumberJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class OneofWithEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class OneofWithEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -147,23 +147,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index a6216aeae3a..12bf75b3f38 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -65,7 +65,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -165,23 +165,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -272,7 +276,7 @@ public static class Schema1MapInput { } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -372,23 +376,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index 41cd098df78..ffa2b8f5a19 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -34,7 +34,7 @@ public class PatternIsNotAnchored { // nest classes so all schemas and input/output classes can be public - public static class PatternIsNotAnchored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class PatternIsNotAnchored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -139,23 +139,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index 5621d7b7c1a..f421797e77b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -34,7 +34,7 @@ public class PatternValidation { // nest classes so all schemas and input/output classes can be public - public static class PatternValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class PatternValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -139,23 +139,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index c480d239538..1d85885a13b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -81,7 +81,7 @@ public static class PropertiesWithEscapedCharactersMapInput { } - public static class PropertiesWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class PropertiesWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -191,23 +191,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index b3902d894b1..88d5b727edc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -61,7 +61,7 @@ public static class PropertyNamedRefThatIsNotAReferenceMapInput { } - public static class PropertyNamedRefThatIsNotAReference1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class PropertyNamedRefThatIsNotAReference1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -166,23 +166,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index a68f5083da5..105d010b57a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -33,7 +33,7 @@ public class RefInAllof { // nest classes so all schemas and input/output classes can be public - public static class RefInAllof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInAllof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -138,23 +138,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index 2c2076c45a4..73ae69465d2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -33,7 +33,7 @@ public class RefInAnyof { // nest classes so all schemas and input/output classes can be public - public static class RefInAnyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInAnyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -138,23 +138,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java index b11c7d3ee5f..88165ad97a1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java @@ -68,7 +68,11 @@ public RefInItemsList getNewInstance(List arg, List pathToItem, PathT for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index 3e365fd1c6a..e8ae9be187c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -33,7 +33,7 @@ public class RefInNot { // nest classes so all schemas and input/output classes can be public - public static class RefInNot1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInNot1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index c45be75cd78..c5c4ff76c16 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -33,7 +33,7 @@ public class RefInOneof { // nest classes so all schemas and input/output classes can be public - public static class RefInOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -138,23 +138,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index 567b49f8561..7dbcaa4b7be 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -63,7 +63,7 @@ public static class RefInPropertyMapInput { } - public static class RefInProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class RefInProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -168,23 +168,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index ae24760969a..bc753d3a123 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -67,7 +67,7 @@ public static class RequiredDefaultValidationMapInput { } - public static class RequiredDefaultValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class RequiredDefaultValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -172,23 +172,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index 4a2ada82353..a213447c77d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -76,7 +76,7 @@ public static class RequiredValidationMapInput { } - public static class RequiredValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class RequiredValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -185,23 +185,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index ea958d2818d..ae0cf3bad36 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -67,7 +67,7 @@ public static class RequiredWithEmptyArrayMapInput { } - public static class RequiredWithEmptyArray1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class RequiredWithEmptyArray1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -172,23 +172,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index 13ce5956a26..f4124401526 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -61,7 +61,7 @@ public static class RequiredWithEscapedCharactersMapInput { } - public static class RequiredWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class RequiredWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -171,23 +171,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index bd4d0ddca56..b75cd4b955e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -33,7 +33,7 @@ public class UniqueitemsFalseValidation { // nest classes so all schemas and input/output classes can be public - public static class UniqueitemsFalseValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UniqueitemsFalseValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 3cd86eeeef1..d07e35b01a4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -33,7 +33,7 @@ public class UniqueitemsValidation { // nest classes so all schemas and input/output classes can be public - public static class UniqueitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UniqueitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index 736f74182bd..2dab65cc98d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -33,7 +33,7 @@ public class UriFormat { // nest classes so all schemas and input/output classes can be public - public static class UriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index 5233de7ab2b..d78df583b9e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -33,7 +33,7 @@ public class UriReferenceFormat { // nest classes so all schemas and input/output classes can be public - public static class UriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index 12b70b784c4..fc8be89998e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -33,7 +33,7 @@ public class UriTemplateFormat { // nest classes so all schemas and input/output classes can be public - public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -136,23 +136,27 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@Nullable Object> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return newInstanceItems; } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public FrozenList<@Nullable Object> validate(List arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs index ed0d6c667fd..68635592410 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs @@ -1,9 +1,9 @@ {{#if types}} -public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements {{#each types}}{{#eq this "null"}}NullSchemaValidator{{else}}{{#eq this "boolean"}}BooleanSchemaValidator{{else}}{{#or (eq this "number") (eq this "integer")}}NumberSchemaValidator{{else}}{{#eq this "string"}}StringSchemaValidator{{else}}{{#eq this "array"}}ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList{{/if}}>{{else}}{{#eq this "object"}}MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}}>{{/eq}}{{/eq}}{{/eq}}{{/or}}{{/eq}}{{/eq}}{{#unless @last}}, {{/unless}}{{/each}} { +public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements {{#each types}}{{#eq this "null"}}NullSchemaValidator{{else}}{{#eq this "boolean"}}BooleanSchemaValidator{{else}}{{#or (eq this "number") (eq this "integer")}}NumberSchemaValidator{{else}}{{#eq this "string"}}StringSchemaValidator{{else}}{{#eq this "array"}}ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<@Nullable Object>{{/if}}>{{else}}{{#eq this "object"}}MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}}>{{/eq}}{{/eq}}{{/eq}}{{/or}}{{/eq}}{{/eq}}{{#unless @last}}, {{/unless}}{{/each}} { {{else}} -public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList{{/if}}>, MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}}> { +public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<@Nullable Object>{{/if}}>, MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}}> { {{/if}} {{#if componentModule}} /* diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs index 03274cc4492..8e0feca93eb 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs @@ -49,18 +49,22 @@ public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{ {{#eq this "array"}} @Override -public {{#if ../arrayOutputJsonPathPiece}}{{../arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<{{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}} getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List<{{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> items = new ArrayList<>(); +public {{#if ../arrayOutputJsonPathPiece}}{{../arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<{{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}} getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<{{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - {{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}} castItem = ({{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + {{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}} castItem = ({{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> newInstanceItems = new FrozenList<>(items); + FrozenList<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> newInstanceItems = new FrozenList<>(items); {{#if ../arrayOutputJsonPathPiece}} return new {{../arrayOutputJsonPathPiece.camelCase}}(newInstanceItems); {{else}} @@ -69,7 +73,7 @@ public {{#if ../arrayOutputJsonPathPiece}}{{../arrayOutputJsonPathPiece.camelCas } @Override -public {{#if ../arrayOutputJsonPathPiece}}{{../arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<{{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}} validate(List<{{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> arg, SchemaConfiguration configuration) throws ValidationException { +public {{#if ../arrayOutputJsonPathPiece}}{{../arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<{{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}} validate(List<{{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -295,18 +299,22 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override -public {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}} getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> items = new ArrayList<>(); +public {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}} getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - {{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}} castItem = ({{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + {{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}} castItem = ({{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> newInstanceItems = new FrozenList<>(items); + FrozenList<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> newInstanceItems = new FrozenList<>(items); {{#if arrayOutputJsonPathPiece}} return new {{arrayOutputJsonPathPiece.camelCase}}(newInstanceItems); {{else}} @@ -315,7 +323,7 @@ public {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{e } @Override -public {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<{{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}} validate(List<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> arg, SchemaConfiguration configuration) throws ValidationException { +public {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<{{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}} validate(List<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs index d3dffd660f4..66de5d961b5 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.lang.reflect.InvocationTargetException; From f9f7a85f46e7375fc8b3b565c0946b207444fb1c Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 19:05:44 -0800 Subject: [PATCH 25/52] Improves map schema getNewInstance --- ...rtiesAllowsASchemaWhichShouldValidate.java | 14 ++++- ...ditionalpropertiesAreAllowedByDefault.java | 14 ++++- .../AdditionalpropertiesCanExistByItself.java | 14 ++++- ...lpropertiesShouldNotLookInApplicators.java | 28 ++++++++-- .../client/components/schemas/Allof.java | 42 ++++++++++++-- .../schemas/AllofCombinedWithAnyofOneof.java | 56 ++++++++++++++++--- .../components/schemas/AllofSimpleTypes.java | 42 ++++++++++++-- .../schemas/AllofWithBaseSchema.java | 42 ++++++++++++-- .../schemas/AllofWithOneEmptySchema.java | 14 ++++- .../schemas/AllofWithTheFirstEmptySchema.java | 14 ++++- .../schemas/AllofWithTheLastEmptySchema.java | 14 ++++- .../schemas/AllofWithTwoEmptySchemas.java | 14 ++++- .../client/components/schemas/Anyof.java | 28 ++++++++-- .../components/schemas/AnyofComplexTypes.java | 42 ++++++++++++-- .../schemas/AnyofWithBaseSchema.java | 28 ++++++++-- .../schemas/AnyofWithOneEmptySchema.java | 14 ++++- .../client/components/schemas/ByInt.java | 14 ++++- .../client/components/schemas/ByNumber.java | 14 ++++- .../components/schemas/BySmallNumber.java | 14 ++++- .../components/schemas/DateTimeFormat.java | 14 ++++- .../components/schemas/EmailFormat.java | 14 ++++- .../components/schemas/EnumsInProperties.java | 14 ++++- .../components/schemas/ForbiddenProperty.java | 14 ++++- .../components/schemas/HostnameFormat.java | 14 ++++- .../schemas/InvalidStringValueForDefault.java | 14 ++++- .../client/components/schemas/Ipv4Format.java | 14 ++++- .../client/components/schemas/Ipv6Format.java | 14 ++++- .../components/schemas/JsonPointerFormat.java | 14 ++++- .../components/schemas/MaximumValidation.java | 14 ++++- .../MaximumValidationWithUnsignedInteger.java | 14 ++++- .../schemas/MaxitemsValidation.java | 14 ++++- .../schemas/MaxlengthValidation.java | 14 ++++- .../Maxproperties0MeansTheObjectIsEmpty.java | 14 ++++- .../schemas/MaxpropertiesValidation.java | 14 ++++- .../components/schemas/MinimumValidation.java | 14 ++++- .../MinimumValidationWithSignedInteger.java | 14 ++++- .../schemas/MinitemsValidation.java | 14 ++++- .../schemas/MinlengthValidation.java | 14 ++++- .../schemas/MinpropertiesValidation.java | 14 ++++- ...NestedAllofToCheckValidationSemantics.java | 28 ++++++++-- ...NestedAnyofToCheckValidationSemantics.java | 28 ++++++++-- ...NestedOneofToCheckValidationSemantics.java | 28 ++++++++-- .../client/components/schemas/Not.java | 14 ++++- .../schemas/NotMoreComplexSchema.java | 28 ++++++++-- .../schemas/ObjectPropertiesValidation.java | 14 ++++- .../client/components/schemas/Oneof.java | 28 ++++++++-- .../components/schemas/OneofComplexTypes.java | 42 ++++++++++++-- .../schemas/OneofWithBaseSchema.java | 28 ++++++++-- .../schemas/OneofWithEmptySchema.java | 14 ++++- .../components/schemas/OneofWithRequired.java | 46 ++++++++++++--- .../schemas/PatternIsNotAnchored.java | 14 ++++- .../components/schemas/PatternValidation.java | 14 ++++- .../PropertiesWithEscapedCharacters.java | 14 ++++- .../PropertyNamedRefThatIsNotAReference.java | 14 ++++- .../schemas/RefInAdditionalproperties.java | 14 ++++- .../client/components/schemas/RefInAllof.java | 14 ++++- .../client/components/schemas/RefInAnyof.java | 14 ++++- .../client/components/schemas/RefInNot.java | 14 ++++- .../client/components/schemas/RefInOneof.java | 14 ++++- .../components/schemas/RefInProperty.java | 14 ++++- .../schemas/RequiredDefaultValidation.java | 14 ++++- .../schemas/RequiredValidation.java | 14 ++++- .../schemas/RequiredWithEmptyArray.java | 14 ++++- .../RequiredWithEscapedCharacters.java | 14 ++++- ...esNotDoAnythingIfThePropertyIsMissing.java | 14 ++++- .../schemas/UniqueitemsFalseValidation.java | 14 ++++- .../schemas/UniqueitemsValidation.java | 14 ++++- .../client/components/schemas/UriFormat.java | 14 ++++- .../schemas/UriReferenceFormat.java | 14 ++++- .../components/schemas/UriTemplateFormat.java | 14 ++++- .../_Schema_anytypeOrMultitype.hbs | 4 +- .../schemas/SchemaClass/_Schema_map.hbs | 2 +- .../SchemaClass/_validate_implementor.hbs | 48 +++++++++++----- 73 files changed, 1167 insertions(+), 207 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index b67a5f0f080..80ac9f9bd2c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -101,11 +101,21 @@ public static AdditionalpropertiesAllowsASchemaWhichShouldValidate1 getInstance( public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index f8887415c5c..8881db3584b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -217,11 +217,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index 0e481a60fc3..fc4f823c2ea 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -74,11 +74,21 @@ public static AdditionalpropertiesCanExistByItself1 getInstance() { public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Boolean castValue = (Boolean) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index db0c8288dfc..c0f57420d85 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -204,11 +204,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -409,11 +419,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public AdditionalpropertiesShouldNotLookInApplicatorsMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Boolean castValue = (Boolean) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index beacc6798c8..35f96a2a028 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -202,11 +202,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -413,11 +423,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema1Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -598,11 +618,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index 4c4e8bf0a01..cb287b1554b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -165,11 +165,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -341,11 +351,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -517,11 +537,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -707,11 +737,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index 33c1ac742ba..142a0f3154c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -164,11 +164,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -340,11 +350,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -525,11 +545,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 0ae95294ed9..3b2f12b2b1c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -203,11 +203,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -414,11 +424,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema1Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -635,11 +655,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index a0ef514aa15..898340fa7cf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -176,11 +176,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index f461bb2e7a9..430cbdcf1da 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -181,11 +181,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 66cced7eaf9..25abff05d15 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -181,11 +181,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index bb202812a10..c8c2521dff9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -180,11 +180,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index 28941d1c857..ad4a03ac03a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -168,11 +168,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -353,11 +363,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index e38caffe10c..38d6f30db02 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -202,11 +202,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -413,11 +423,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema1Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -598,11 +618,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index f906c8982b7..78ccd9eb41c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -164,11 +164,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -340,11 +350,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index fee7548c198..e80f0a77394 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -181,11 +181,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 3eb8211cd7f..7a678610494 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -171,11 +171,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 41a179fc9e2..a567c6ab41b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -171,11 +171,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index 64dac8ef2bd..ca968d0a82a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -171,11 +171,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index cd783715df9..5e849c38825 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index 902c7d77d73..fc3abf2ddda 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index f112cfdd8eb..2e9aa43926e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -176,11 +176,21 @@ public static EnumsInProperties1 getInstance() { public EnumsInPropertiesMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 04c5b9f7280..0b80d60a49f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -208,11 +208,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public ForbiddenPropertyMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index a16804026f7..1da679d072b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 7e13b6a0dee..5b54a71b113 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -241,11 +241,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public InvalidStringValueForDefaultMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index c27eb428fb5..bf3ecdbaaf5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index 7e64360f711..8645d0f8100 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index d8e3410c39e..63beb848474 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index a4298cf64b0..f509f87f84b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 00ba25a8970..6d7286af3df 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index a7dea0dd76e..eec67d5168b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 5cfaa46fb7d..f8f1aa3641e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index 971e502ca7e..9d19255e847 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index aeb678be750..c7755ac4240 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index ec9b08fbd23..54a8b0dfe54 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index b544a895c24..6a82c51e84b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index 4d79e0a97ea..ea386f9c4eb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index ea561277077..36b95ab0b85 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index cb022deda31..e12095cf91f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 7080e9a6711..27cdf9a2f2d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -354,11 +364,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index 85d1b687c36..d80a9bee62a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -354,11 +364,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index 78dc4013ce4..3cb458246d5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -354,11 +364,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index fbf0b6aecf2..22dfa79caa8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -174,11 +174,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 2008c1a44fd..92f52766628 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -89,11 +89,21 @@ public static Not getInstance() { public NotMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -260,11 +270,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index c84d3c2f2b7..e3388572a7b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -218,11 +218,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public ObjectPropertiesValidationMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index c144816174c..a084aa2499c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -168,11 +168,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -353,11 +363,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index 85818bff679..138b4bea6d8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -202,11 +202,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -413,11 +423,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema1Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -598,11 +618,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index aeb9d439958..0dee7d73096 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -164,11 +164,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -340,11 +350,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index b32450e6865..8eac7df1d20 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -181,11 +181,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 12bf75b3f38..62789a7633c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -199,11 +199,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -410,11 +420,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public Schema1Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -481,14 +501,24 @@ public static OneofWithRequired1 getInstance() { return instance; } - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -497,7 +527,7 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index ffa2b8f5a19..8a9792f07b7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -173,11 +173,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index f421797e77b..0e90846adc4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -173,11 +173,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 1d85885a13b..ce9e6fc9ba8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -225,11 +225,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 88d5b727edc..b0a2edc975e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -200,11 +200,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 4309f66741a..544d641ae0b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -70,11 +70,21 @@ public static RefInAdditionalproperties1 getInstance() { public RefInAdditionalpropertiesMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index 105d010b57a..8331c0ae795 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -172,11 +172,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index 73ae69465d2..b78c919d796 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -172,11 +172,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index e8ae9be187c..2cbda1985c4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index c5c4ff76c16..54c31e85fe4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -172,11 +172,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index 7dbcaa4b7be..ced22e79e17 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -202,11 +202,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public RefInPropertyMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index bc753d3a123..1f3ef01c8eb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -206,11 +206,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public RequiredDefaultValidationMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index a213447c77d..3c9df38b4fa 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -219,11 +219,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public RequiredValidationMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index ae0cf3bad36..33cc6aa1478 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -206,11 +206,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public RequiredWithEmptyArrayMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index f4124401526..ecdc06d3e56 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -205,11 +205,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 3d3e4e90fb9..89fe9231500 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -140,11 +140,21 @@ public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1 getInsta public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index b75cd4b955e..f0f3e486e7b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index d07e35b01a4..af6eec8f9db 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index 2dab65cc98d..a458a4e30d9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index d78df583b9e..fa6288fe941 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index fc8be89998e..5f774959722 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -170,11 +170,21 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs index 68635592410..097fce519b6 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs @@ -1,9 +1,9 @@ {{#if types}} -public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements {{#each types}}{{#eq this "null"}}NullSchemaValidator{{else}}{{#eq this "boolean"}}BooleanSchemaValidator{{else}}{{#or (eq this "number") (eq this "integer")}}NumberSchemaValidator{{else}}{{#eq this "string"}}StringSchemaValidator{{else}}{{#eq this "array"}}ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<@Nullable Object>{{/if}}>{{else}}{{#eq this "object"}}MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}}>{{/eq}}{{/eq}}{{/eq}}{{/or}}{{/eq}}{{/eq}}{{#unless @last}}, {{/unless}}{{/each}} { +public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements {{#each types}}{{#eq this "null"}}NullSchemaValidator{{else}}{{#eq this "boolean"}}BooleanSchemaValidator{{else}}{{#or (eq this "number") (eq this "integer")}}NumberSchemaValidator{{else}}{{#eq this "string"}}StringSchemaValidator{{else}}{{#eq this "array"}}ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<@Nullable Object>{{/if}}>{{else}}{{#eq this "object"}}MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}>{{/eq}}{{/eq}}{{/eq}}{{/or}}{{/eq}}{{/eq}}{{#unless @last}}, {{/unless}}{{/each}} { {{else}} -public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<@Nullable Object>{{/if}}>, MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}}> { +public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<@Nullable Object>{{/if}}>, MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}> { {{/if}} {{#if componentModule}} /* diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs index 2d9f3230d1a..b466a06e17e 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs @@ -1,6 +1,6 @@ -public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}}> { +public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}> { {{#if componentModule}} /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs index 8e0feca93eb..b71b8d3932c 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs @@ -15,18 +15,28 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat {{/eq}} {{#eq this "object"}} -public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap{{/if}} getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> properties = new LinkedHashMap<>(); +public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<@Nullable Object>{{/if}} getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - {{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}} castValue = ({{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + {{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}} castValue = ({{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap<{{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> castProperties = new FrozenMap<>(properties); + FrozenMap<{{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> castProperties = new FrozenMap<>(properties); {{#if ../mapOutputJsonPathPiece}} return new {{mapOutputJsonPathPiece.camelCase}}(castProperties); {{else}} @@ -35,7 +45,7 @@ public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{ } @Override -public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap{{/if}} validate(Map src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { +public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<@Nullable Object>{{/if}} validate(Map src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -334,18 +344,28 @@ public {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{e } @Override -public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}} getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> properties = new LinkedHashMap<>(); +public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}} getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + @NonNull String propertyName; + if (entryKey instanceof String) { + propertyName = (@NonNull String) entryKey; + } else { + throw new RuntimeException("Invalid non-string key value"); + } List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - {{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}} castValue = ({{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + {{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}} castValue = ({{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> castProperties = new FrozenMap<>(properties); + FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> castProperties = new FrozenMap<>(properties); {{#if ../mapOutputJsonPathPiece}} return new {{mapOutputJsonPathPiece.camelCase}}(castProperties); {{else}} @@ -354,7 +374,7 @@ public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else} } @Override -public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}>{{/if}} validate(Map src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { +public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}} validate(Map src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}> arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); From 5e9eb20b6b43d6da36ec57e235bee7ea4f656e5f Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 19:17:41 -0800 Subject: [PATCH 26/52] Improves outputtypes --- ...pertiesAllowsASchemaWhichShouldValidate.md | 6 +-- ...AdditionalpropertiesAreAllowedByDefault.md | 6 +-- ...nalpropertiesShouldNotLookInApplicators.md | 4 +- .../java/docs/components/schemas/Allof.md | 4 +- .../components/schemas/AllofWithBaseSchema.md | 6 +-- .../components/schemas/AnyofComplexTypes.md | 4 +- .../schemas/ArrayTypeMatchesArrays.md | 2 +- .../components/schemas/EnumsInProperties.md | 2 +- .../components/schemas/ForbiddenProperty.md | 4 +- .../schemas/InvalidStringValueForDefault.md | 2 +- .../schemas/NotMoreComplexSchema.md | 2 +- .../schemas/ObjectPropertiesValidation.md | 2 +- .../components/schemas/OneofComplexTypes.md | 4 +- .../components/schemas/OneofWithRequired.md | 12 ++--- .../PropertiesWithEscapedCharacters.md | 4 +- .../PropertyNamedRefThatIsNotAReference.md | 4 +- .../schemas/RefInAdditionalproperties.md | 4 +- .../docs/components/schemas/RefInItems.md | 2 +- .../docs/components/schemas/RefInProperty.md | 4 +- .../schemas/RequiredDefaultValidation.md | 4 +- .../components/schemas/RequiredValidation.md | 6 +-- .../schemas/RequiredWithEmptyArray.md | 4 +- .../schemas/RequiredWithEscapedCharacters.md | 4 +- ...DoesNotDoAnythingIfThePropertyIsMissing.md | 2 +- ...rtiesAllowsASchemaWhichShouldValidate.java | 14 +++--- ...ditionalpropertiesAreAllowedByDefault.java | 14 +++--- ...lpropertiesShouldNotLookInApplicators.java | 12 ++--- .../client/components/schemas/Allof.java | 32 ++++++------- .../schemas/AllofCombinedWithAnyofOneof.java | 48 +++++++++---------- .../components/schemas/AllofSimpleTypes.java | 36 +++++++------- .../schemas/AllofWithBaseSchema.java | 30 ++++++------ .../schemas/AllofWithOneEmptySchema.java | 12 ++--- .../schemas/AllofWithTheFirstEmptySchema.java | 12 ++--- .../schemas/AllofWithTheLastEmptySchema.java | 12 ++--- .../schemas/AllofWithTwoEmptySchemas.java | 12 ++--- .../client/components/schemas/Anyof.java | 24 +++++----- .../components/schemas/AnyofComplexTypes.java | 32 ++++++------- .../schemas/AnyofWithBaseSchema.java | 24 +++++----- .../schemas/AnyofWithOneEmptySchema.java | 12 ++--- .../schemas/ArrayTypeMatchesArrays.java | 10 ++-- .../client/components/schemas/ByInt.java | 12 ++--- .../client/components/schemas/ByNumber.java | 12 ++--- .../components/schemas/BySmallNumber.java | 12 ++--- .../components/schemas/DateTimeFormat.java | 12 ++--- .../components/schemas/EmailFormat.java | 12 ++--- .../components/schemas/EnumsInProperties.java | 10 ++-- .../components/schemas/ForbiddenProperty.java | 12 ++--- .../components/schemas/HostnameFormat.java | 12 ++--- .../schemas/InvalidStringValueForDefault.java | 10 ++-- .../client/components/schemas/Ipv4Format.java | 12 ++--- .../client/components/schemas/Ipv6Format.java | 12 ++--- .../components/schemas/JsonPointerFormat.java | 12 ++--- .../components/schemas/MaximumValidation.java | 12 ++--- .../MaximumValidationWithUnsignedInteger.java | 12 ++--- .../schemas/MaxitemsValidation.java | 12 ++--- .../schemas/MaxlengthValidation.java | 12 ++--- .../Maxproperties0MeansTheObjectIsEmpty.java | 12 ++--- .../schemas/MaxpropertiesValidation.java | 12 ++--- .../components/schemas/MinimumValidation.java | 12 ++--- .../MinimumValidationWithSignedInteger.java | 12 ++--- .../schemas/MinitemsValidation.java | 12 ++--- .../schemas/MinlengthValidation.java | 12 ++--- .../schemas/MinpropertiesValidation.java | 12 ++--- ...NestedAllofToCheckValidationSemantics.java | 24 +++++----- ...NestedAnyofToCheckValidationSemantics.java | 24 +++++----- ...NestedOneofToCheckValidationSemantics.java | 24 +++++----- .../client/components/schemas/Not.java | 12 ++--- .../schemas/NotMoreComplexSchema.java | 22 ++++----- .../schemas/ObjectPropertiesValidation.java | 10 ++-- .../client/components/schemas/Oneof.java | 24 +++++----- .../components/schemas/OneofComplexTypes.java | 32 ++++++------- .../schemas/OneofWithBaseSchema.java | 24 +++++----- .../schemas/OneofWithEmptySchema.java | 12 ++--- .../components/schemas/OneofWithRequired.java | 28 +++++------ .../schemas/PatternIsNotAnchored.java | 12 ++--- .../components/schemas/PatternValidation.java | 12 ++--- .../PropertiesWithEscapedCharacters.java | 10 ++-- .../PropertyNamedRefThatIsNotAReference.java | 10 ++-- .../schemas/RefInAdditionalproperties.java | 12 ++--- .../client/components/schemas/RefInAllof.java | 12 ++--- .../client/components/schemas/RefInAnyof.java | 12 ++--- .../client/components/schemas/RefInItems.java | 10 ++-- .../client/components/schemas/RefInNot.java | 12 ++--- .../client/components/schemas/RefInOneof.java | 12 ++--- .../components/schemas/RefInProperty.java | 14 +++--- .../schemas/RequiredDefaultValidation.java | 12 ++--- .../schemas/RequiredValidation.java | 14 +++--- .../schemas/RequiredWithEmptyArray.java | 12 ++--- .../RequiredWithEscapedCharacters.java | 10 ++-- ...esNotDoAnythingIfThePropertyIsMissing.java | 10 ++-- .../schemas/UniqueitemsFalseValidation.java | 12 ++--- .../schemas/UniqueitemsValidation.java | 12 ++--- .../client/components/schemas/UriFormat.java | 12 ++--- .../schemas/UriReferenceFormat.java | 12 ++--- .../components/schemas/UriTemplateFormat.java | 12 ++--- .../types/_schema_output_type_base.hbs | 44 +++++++++-------- 96 files changed, 618 insertions(+), 614 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md index 812f528e5a7..31e37f08468 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md @@ -76,7 +76,7 @@ A class that builds the Map input type ## AdditionalpropertiesAllowsASchemaWhichShouldValidateMap public static class AdditionalpropertiesAllowsASchemaWhichShouldValidateMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -84,8 +84,8 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) | of([Map](#additionalpropertiesallowsaschemawhichshouldvalidatemapinput) arg, SchemaConfiguration configuration) | -| Object | foo()
[optional] | -| Object | bar()
[optional] | +| @Nullable Object | foo()
[optional] | +| @Nullable Object | bar()
[optional] | | boolean | getAdditionalProperty(String name)
provides type safety for additional properties | ## Bar diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md index aee08c84d47..724177f700e 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md @@ -57,7 +57,7 @@ A class that builds the Map input type ## AdditionalpropertiesAreAllowedByDefaultMap public static class AdditionalpropertiesAreAllowedByDefaultMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -65,8 +65,8 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) | of([Map](#additionalpropertiesareallowedbydefaultmapinput) arg, SchemaConfiguration configuration) | -| Object | foo()
[optional] | -| Object | bar()
[optional] | +| @Nullable Object | foo()
[optional] | +| @Nullable Object | bar()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Bar diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md index 771dcf155a2..528fe0a028b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md @@ -107,7 +107,7 @@ A class that builds the Map input type ## Schema0Map public static class Schema0Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -115,7 +115,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | -| Object | foo()
[optional] | +| @Nullable Object | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md index f3fd5969d50..7791aefeacf 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md @@ -85,7 +85,7 @@ A class that builds the Map input type ## Schema1Map public static class Schema1Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -145,7 +145,7 @@ A class that builds the Map input type ## Schema0Map public static class Schema0Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md index 4f5ca1116cd..295dcfb4ef7 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md @@ -65,7 +65,7 @@ A class that builds the Map input type ## AllofWithBaseSchemaMap public static class AllofWithBaseSchemaMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -125,7 +125,7 @@ A class that builds the Map input type ## Schema1Map public static class Schema1Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -185,7 +185,7 @@ A class that builds the Map input type ## Schema0Map public static class Schema0Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md index 01a619c4022..21921a7eb2c 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md @@ -85,7 +85,7 @@ A class that builds the Map input type ## Schema1Map public static class Schema1Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -145,7 +145,7 @@ A class that builds the Map input type ## Schema0Map public static class Schema0Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md index eadf9051449..6056a072f56 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md @@ -71,7 +71,7 @@ Object | | ## ArrayTypeMatchesArraysList public class ArrayTypeMatchesArraysList
-extends `FrozenList` +extends `FrozenList<@Nullable Object>` A class to store validated List payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md index 1791e90253b..88d4b1d505b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md @@ -83,7 +83,7 @@ A class that builds the Map input type ## EnumsInPropertiesMap public static class EnumsInPropertiesMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md index cf51444902a..cdb9490f13e 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md @@ -55,7 +55,7 @@ A class that builds the Map input type ## ForbiddenPropertyMap public static class ForbiddenPropertyMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -63,7 +63,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [ForbiddenPropertyMap](#forbiddenpropertymap) | of([Map](#forbiddenpropertymapinput) arg, SchemaConfiguration configuration) | -| Object | foo()
[optional] | +| @Nullable Object | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md index 82d432b975b..bbb7e03d06b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md @@ -55,7 +55,7 @@ A class that builds the Map input type ## InvalidStringValueForDefaultMap public static class InvalidStringValueForDefaultMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md index 158c174dc5b..8d7270325bb 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md @@ -101,7 +101,7 @@ A class that builds the Map input type ## NotMap public static class NotMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md index 35aef63c36a..0dfbac98c39 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md @@ -57,7 +57,7 @@ A class that builds the Map input type ## ObjectPropertiesValidationMap public static class ObjectPropertiesValidationMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md index c054597d115..39f86c18df2 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md @@ -85,7 +85,7 @@ A class that builds the Map input type ## Schema1Map public static class Schema1Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -145,7 +145,7 @@ A class that builds the Map input type ## Schema0Map public static class Schema0Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md index 392d3468ed4..3572671d136 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md @@ -76,7 +76,7 @@ A class that builds the Map input type ## Schema1Map public static class Schema1Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -84,8 +84,8 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | -| Object | baz()
| -| Object | foo()
| +| @Nullable Object | baz()
| +| @Nullable Object | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Schema0 @@ -127,7 +127,7 @@ A class that builds the Map input type ## Schema0Map public static class Schema0Map
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -135,8 +135,8 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | -| Object | bar()
| -| Object | foo()
| +| @Nullable Object | bar()
| +| @Nullable Object | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md index 3f3747836de..e087f56ce20 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md @@ -65,7 +65,7 @@ A class that builds the Map input type ## PropertiesWithEscapedCharactersMap public static class PropertiesWithEscapedCharactersMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -73,7 +73,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) | of([Map](#propertieswithescapedcharactersmapinput) arg, SchemaConfiguration configuration) | -| Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["foo\nbar"], instance["foo\"bar"], instance["foo\\bar"], instance["foo\rbar"], instance["foo\tbar"], instance["foo\fbar"], | +| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["foo\nbar"], instance["foo\"bar"], instance["foo\\bar"], instance["foo\rbar"], instance["foo\tbar"], instance["foo\fbar"], | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foofbar diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md index b9c77d04ba6..0cecdca134b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md @@ -55,7 +55,7 @@ A class that builds the Map input type ## PropertyNamedRefThatIsNotAReferenceMap public static class PropertyNamedRefThatIsNotAReferenceMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -63,7 +63,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) | of([Map](#propertynamedrefthatisnotareferencemapinput) arg, SchemaConfiguration configuration) | -| Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["$ref"], | +| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["$ref"], | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Ref diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md index 038081b3c0a..fc222d7ebfa 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md @@ -70,7 +70,7 @@ A class that builds the Map input type ## RefInAdditionalpropertiesMap public static class RefInAdditionalpropertiesMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -78,6 +78,6 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [RefInAdditionalpropertiesMap](#refinadditionalpropertiesmap) | of([Map](#refinadditionalpropertiesmapinput) arg, SchemaConfiguration configuration) | -| Object | getAdditionalProperty(String name)
provides type safety for additional properties | +| @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md index 1857920b2d9..42021e1e4c2 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md @@ -70,7 +70,7 @@ Object | | ## RefInItemsList public class RefInItemsList
-extends `FrozenList` +extends `FrozenList<@Nullable Object>` A class to store validated List payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md index 52c955f04e9..71a7b907614 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md @@ -54,7 +54,7 @@ A class that builds the Map input type ## RefInPropertyMap public static class RefInPropertyMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -62,7 +62,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [RefInPropertyMap](#refinpropertymap) | of([Map](#refinpropertymapinput) arg, SchemaConfiguration configuration) | -| Object | a()
[optional] | +| @Nullable Object | a()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md index e36f45add70..4ed8beeff15 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md @@ -55,7 +55,7 @@ A class that builds the Map input type ## RequiredDefaultValidationMap public static class RequiredDefaultValidationMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -63,7 +63,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [RequiredDefaultValidationMap](#requireddefaultvalidationmap) | of([Map](#requireddefaultvalidationmapinput) arg, SchemaConfiguration configuration) | -| Object | foo()
[optional] | +| @Nullable Object | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md index c6af00a6cfe..15cd09c5fcd 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md @@ -58,7 +58,7 @@ A class that builds the Map input type ## RequiredValidationMap public static class RequiredValidationMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -66,8 +66,8 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [RequiredValidationMap](#requiredvalidationmap) | of([Map](#requiredvalidationmapinput) arg, SchemaConfiguration configuration) | -| Object | foo()
| -| Object | bar()
[optional] | +| @Nullable Object | foo()
| +| @Nullable Object | bar()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Bar diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md index e3f6e97f8f5..cccf3dd920c 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md @@ -55,7 +55,7 @@ A class that builds the Map input type ## RequiredWithEmptyArrayMap public static class RequiredWithEmptyArrayMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -63,7 +63,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) | of([Map](#requiredwithemptyarraymapinput) arg, SchemaConfiguration configuration) | -| Object | foo()
[optional] | +| @Nullable Object | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md index cac3bac680a..c0d0a0c64e2 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md @@ -59,7 +59,7 @@ A class that builds the Map input type ## RequiredWithEscapedCharactersMap public static class RequiredWithEscapedCharactersMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads @@ -67,7 +67,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) | of([Map](#requiredwithescapedcharactersmapinput) arg, SchemaConfiguration configuration) | -| Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["foo\tbar"], instance["foo\nbar"], instance["foo\fbar"], instance["foo\rbar"], instance["foo\"bar"], instance["foo\\bar"], | +| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["foo\tbar"], instance["foo\nbar"], instance["foo\fbar"], instance["foo\rbar"], instance["foo\"bar"], instance["foo\\bar"], | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md index ad4a9b4e867..973eaace1dc 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md @@ -76,7 +76,7 @@ A class that builds the Map input type ## TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 80ac9f9bd2c..378cb3f8c7c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -36,8 +36,8 @@ public static class Foo extends AnyTypeJsonSchema {} public static class Bar extends AnyTypeJsonSchema {} - public static class AdditionalpropertiesAllowsASchemaWhichShouldValidateMap extends FrozenMap { - protected AdditionalpropertiesAllowsASchemaWhichShouldValidateMap(FrozenMap m) { + public static class AdditionalpropertiesAllowsASchemaWhichShouldValidateMap extends FrozenMap<@Nullable Object> { + protected AdditionalpropertiesAllowsASchemaWhichShouldValidateMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -49,13 +49,13 @@ public static AdditionalpropertiesAllowsASchemaWhichShouldValidateMap of(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -116,10 +116,10 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap getNewInstance(Ma throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new AdditionalpropertiesAllowsASchemaWhichShouldValidateMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index 8881db3584b..64e685c3b18 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -41,8 +41,8 @@ public static class Foo extends AnyTypeJsonSchema {} public static class Bar extends AnyTypeJsonSchema {} - public static class AdditionalpropertiesAreAllowedByDefaultMap extends FrozenMap { - protected AdditionalpropertiesAreAllowedByDefaultMap(FrozenMap m) { + public static class AdditionalpropertiesAreAllowedByDefaultMap extends FrozenMap<@Nullable Object> { + protected AdditionalpropertiesAreAllowedByDefaultMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -54,13 +54,13 @@ public static AdditionalpropertiesAreAllowedByDefaultMap of(Map return AdditionalpropertiesAreAllowedByDefault1.getInstance().validate(arg, configuration); } - public Object foo() { + public @Nullable Object foo() { String key = "foo"; throwIfKeyNotPresent(key); return get(key); } - public Object bar() { + public @Nullable Object bar() { String key = "bar"; throwIfKeyNotPresent(key); return get(key); @@ -215,7 +215,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -232,10 +232,10 @@ public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new AdditionalpropertiesAreAllowedByDefaultMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index c0f57420d85..d4ed036b87c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -42,8 +42,8 @@ public static class AdditionalProperties extends BooleanJsonSchema {} public static class Foo extends AnyTypeJsonSchema {} - public static class Schema0Map extends FrozenMap { - protected Schema0Map(FrozenMap m) { + public static class Schema0Map extends FrozenMap<@Nullable Object> { + protected Schema0Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -54,7 +54,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu return Schema0.getInstance().validate(arg, configuration); } - public Object foo() { + public @Nullable Object foo() { String key = "foo"; throwIfKeyNotPresent(key); return get(key); @@ -202,7 +202,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -219,10 +219,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 35f96a2a028..07f034036d8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -39,8 +39,8 @@ public class Allof { public static class Bar extends IntJsonSchema {} - public static class Schema0Map extends FrozenMap { - protected Schema0Map(FrozenMap m) { + public static class Schema0Map extends FrozenMap<@Nullable Object> { + protected Schema0Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -200,7 +200,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -217,10 +217,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); } @@ -260,8 +260,8 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur public static class Foo extends StringJsonSchema {} - public static class Schema1Map extends FrozenMap { - protected Schema1Map(FrozenMap m) { + public static class Schema1Map extends FrozenMap<@Nullable Object> { + protected Schema1Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -421,7 +421,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema1Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -438,10 +438,10 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema1Map(castProperties); } @@ -478,7 +478,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class Allof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Allof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -615,8 +615,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -633,15 +633,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index cb287b1554b..33943d41ae3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -34,7 +34,7 @@ public class AllofCombinedWithAnyofOneof { // nest classes so all schemas and input/output classes can be public - public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema02 instance = null; protected Schema02() { @@ -162,8 +162,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -180,15 +180,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -220,7 +220,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -348,8 +348,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -366,15 +366,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -406,7 +406,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -534,8 +534,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -552,15 +552,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -592,7 +592,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -734,8 +734,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -752,15 +752,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index 142a0f3154c..aae223a1cd1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -33,7 +33,7 @@ public class AllofSimpleTypes { // nest classes so all schemas and input/output classes can be public - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -161,8 +161,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -179,15 +179,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -219,7 +219,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -347,8 +347,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -365,15 +365,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -405,7 +405,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -542,8 +542,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -560,15 +560,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 3b2f12b2b1c..b25d8f38751 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -40,8 +40,8 @@ public class AllofWithBaseSchema { public static class Foo extends StringJsonSchema {} - public static class Schema0Map extends FrozenMap { - protected Schema0Map(FrozenMap m) { + public static class Schema0Map extends FrozenMap<@Nullable Object> { + protected Schema0Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -201,7 +201,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -218,10 +218,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); } @@ -261,8 +261,8 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur public static class Baz extends NullJsonSchema {} - public static class Schema1Map extends FrozenMap { - protected Schema1Map(FrozenMap m) { + public static class Schema1Map extends FrozenMap<@Nullable Object> { + protected Schema1Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -422,7 +422,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema1Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -439,10 +439,10 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema1Map(castProperties); } @@ -482,8 +482,8 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur public static class Bar extends IntJsonSchema {} - public static class AllofWithBaseSchemaMap extends FrozenMap { - protected AllofWithBaseSchemaMap(FrozenMap m) { + public static class AllofWithBaseSchemaMap extends FrozenMap<@Nullable Object> { + protected AllofWithBaseSchemaMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -653,7 +653,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -670,10 +670,10 @@ public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToI throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new AllofWithBaseSchemaMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index 898340fa7cf..0a2ecc8d800 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -37,7 +37,7 @@ public class AllofWithOneEmptySchema { public static class Schema0 extends AnyTypeJsonSchema {} - public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -173,8 +173,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -191,15 +191,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 430cbdcf1da..9028832886a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -41,7 +41,7 @@ public static class Schema0 extends AnyTypeJsonSchema {} public static class Schema1 extends NumberJsonSchema {} - public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -178,8 +178,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -196,15 +196,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 25abff05d15..453ffa83ec7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -41,7 +41,7 @@ public static class Schema0 extends NumberJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -178,8 +178,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -196,15 +196,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index c8c2521dff9..27c6e99aef5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -40,7 +40,7 @@ public static class Schema0 extends AnyTypeJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -177,8 +177,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -195,15 +195,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index ad4a03ac03a..46d342eb1e3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -37,7 +37,7 @@ public class Anyof { public static class Schema0 extends IntJsonSchema {} - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -165,8 +165,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -183,15 +183,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -223,7 +223,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Anyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Anyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -360,8 +360,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -378,15 +378,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 38d6f30db02..8fcba927fe5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -39,8 +39,8 @@ public class AnyofComplexTypes { public static class Bar extends IntJsonSchema {} - public static class Schema0Map extends FrozenMap { - protected Schema0Map(FrozenMap m) { + public static class Schema0Map extends FrozenMap<@Nullable Object> { + protected Schema0Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -200,7 +200,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -217,10 +217,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); } @@ -260,8 +260,8 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur public static class Foo extends StringJsonSchema {} - public static class Schema1Map extends FrozenMap { - protected Schema1Map(FrozenMap m) { + public static class Schema1Map extends FrozenMap<@Nullable Object> { + protected Schema1Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -421,7 +421,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema1Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -438,10 +438,10 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema1Map(castProperties); } @@ -478,7 +478,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -615,8 +615,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -633,15 +633,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index 78ccd9eb41c..e313bdd70a0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -33,7 +33,7 @@ public class AnyofWithBaseSchema { // nest classes so all schemas and input/output classes can be public - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -161,8 +161,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -179,15 +179,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -219,7 +219,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -347,8 +347,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -365,15 +365,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index e80f0a77394..bddb6ee4993 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -41,7 +41,7 @@ public static class Schema0 extends NumberJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -178,8 +178,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -196,15 +196,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java index c0ef9f311ee..e0af052df8c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java @@ -28,8 +28,8 @@ public class ArrayTypeMatchesArrays { public static class Items extends AnyTypeJsonSchema {} - public static class ArrayTypeMatchesArraysList extends FrozenList { - protected ArrayTypeMatchesArraysList(FrozenList m) { + public static class ArrayTypeMatchesArraysList extends FrozenList<@Nullable Object> { + protected ArrayTypeMatchesArraysList(FrozenList<@Nullable Object> m) { super(m); } public static ArrayTypeMatchesArraysList of(List arg, SchemaConfiguration configuration) throws ValidationException { @@ -67,7 +67,7 @@ public static ArrayTypeMatchesArrays1 getInstance() { @Override public ArrayTypeMatchesArraysList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -77,11 +77,11 @@ public ArrayTypeMatchesArraysList getNewInstance(List arg, List pathT throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return new ArrayTypeMatchesArraysList(newInstanceItems); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 7a678610494..0d610c8803e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -34,7 +34,7 @@ public class ByInt { // nest classes so all schemas and input/output classes can be public - public static class ByInt1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class ByInt1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -168,8 +168,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -186,15 +186,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index a567c6ab41b..42f1b8bf837 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -34,7 +34,7 @@ public class ByNumber { // nest classes so all schemas and input/output classes can be public - public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -168,8 +168,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -186,15 +186,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index ca968d0a82a..aecb3ef28c5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -34,7 +34,7 @@ public class BySmallNumber { // nest classes so all schemas and input/output classes can be public - public static class BySmallNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class BySmallNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -168,8 +168,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -186,15 +186,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 5e849c38825..1b15df51032 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -33,7 +33,7 @@ public class DateTimeFormat { // nest classes so all schemas and input/output classes can be public - public static class DateTimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class DateTimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index fc3abf2ddda..44907e5d4de 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -33,7 +33,7 @@ public class EmailFormat { // nest classes so all schemas and input/output classes can be public - public static class EmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class EmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index 2e9aa43926e..b4cf48edc8e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -109,8 +109,8 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } } - public static class EnumsInPropertiesMap extends FrozenMap { - protected EnumsInPropertiesMap(FrozenMap m) { + public static class EnumsInPropertiesMap extends FrozenMap<@Nullable Object> { + protected EnumsInPropertiesMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -174,7 +174,7 @@ public static EnumsInProperties1 getInstance() { } public EnumsInPropertiesMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -191,10 +191,10 @@ public EnumsInPropertiesMap getNewInstance(Map arg, List pathToIte throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new EnumsInPropertiesMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 0b80d60a49f..6029dc9d01e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -40,8 +40,8 @@ public static class Foo extends NotAnyTypeJsonSchema {} // NotAnyTypeSchema - public static class ForbiddenPropertyMap extends FrozenMap { - protected ForbiddenPropertyMap(FrozenMap m) { + public static class ForbiddenPropertyMap extends FrozenMap<@Nullable Object> { + protected ForbiddenPropertyMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -52,7 +52,7 @@ public static ForbiddenPropertyMap of(Map arg, SchemaConfigurati return ForbiddenProperty1.getInstance().validate(arg, configuration); } - public Object foo() { + public @Nullable Object foo() { String key = "foo"; throwIfKeyNotPresent(key); return get(key); @@ -206,7 +206,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public ForbiddenPropertyMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -223,10 +223,10 @@ public ForbiddenPropertyMap getNewInstance(Map arg, List pathToIte throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new ForbiddenPropertyMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 1da679d072b..19e49503f5f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -33,7 +33,7 @@ public class HostnameFormat { // nest classes so all schemas and input/output classes can be public - public static class HostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class HostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 5b54a71b113..17fa48cce42 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -73,8 +73,8 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val } } - public static class InvalidStringValueForDefaultMap extends FrozenMap { - protected InvalidStringValueForDefaultMap(FrozenMap m) { + public static class InvalidStringValueForDefaultMap extends FrozenMap<@Nullable Object> { + protected InvalidStringValueForDefaultMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -239,7 +239,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public InvalidStringValueForDefaultMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -256,10 +256,10 @@ public InvalidStringValueForDefaultMap getNewInstance(Map arg, List castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new InvalidStringValueForDefaultMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index bf3ecdbaaf5..381b3071929 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -33,7 +33,7 @@ public class Ipv4Format { // nest classes so all schemas and input/output classes can be public - public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index 8645d0f8100..5f83d39ac5e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -33,7 +33,7 @@ public class Ipv6Format { // nest classes so all schemas and input/output classes can be public - public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 63beb848474..b2492545252 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -33,7 +33,7 @@ public class JsonPointerFormat { // nest classes so all schemas and input/output classes can be public - public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index f509f87f84b..6536b088eb7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -33,7 +33,7 @@ public class MaximumValidation { // nest classes so all schemas and input/output classes can be public - public static class MaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 6d7286af3df..0fc866aa132 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -33,7 +33,7 @@ public class MaximumValidationWithUnsignedInteger { // nest classes so all schemas and input/output classes can be public - public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index eec67d5168b..e1b74cb11f5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -33,7 +33,7 @@ public class MaxitemsValidation { // nest classes so all schemas and input/output classes can be public - public static class MaxitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaxitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index f8f1aa3641e..06e44575271 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -33,7 +33,7 @@ public class MaxlengthValidation { // nest classes so all schemas and input/output classes can be public - public static class MaxlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaxlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index 9d19255e847..51f8c53b672 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -33,7 +33,7 @@ public class Maxproperties0MeansTheObjectIsEmpty { // nest classes so all schemas and input/output classes can be public - public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index c7755ac4240..245aa8bdb17 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -33,7 +33,7 @@ public class MaxpropertiesValidation { // nest classes so all schemas and input/output classes can be public - public static class MaxpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaxpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index 54a8b0dfe54..adbe606fe47 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -33,7 +33,7 @@ public class MinimumValidation { // nest classes so all schemas and input/output classes can be public - public static class MinimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index 6a82c51e84b..43fa9574acb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -33,7 +33,7 @@ public class MinimumValidationWithSignedInteger { // nest classes so all schemas and input/output classes can be public - public static class MinimumValidationWithSignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinimumValidationWithSignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index ea386f9c4eb..3c84f900644 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -33,7 +33,7 @@ public class MinitemsValidation { // nest classes so all schemas and input/output classes can be public - public static class MinitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 36b95ab0b85..18ab065d429 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -33,7 +33,7 @@ public class MinlengthValidation { // nest classes so all schemas and input/output classes can be public - public static class MinlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index e12095cf91f..40053563a9b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -33,7 +33,7 @@ public class MinpropertiesValidation { // nest classes so all schemas and input/output classes can be public - public static class MinpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 27cdf9a2f2d..748e9703f69 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -37,7 +37,7 @@ public class NestedAllofToCheckValidationSemantics { public static class Schema01 extends NullJsonSchema {} - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -225,7 +225,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -361,8 +361,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -379,15 +379,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index d80a9bee62a..a65c4cf8ffc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -37,7 +37,7 @@ public class NestedAnyofToCheckValidationSemantics { public static class Schema01 extends NullJsonSchema {} - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -225,7 +225,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -361,8 +361,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -379,15 +379,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index 3cb458246d5..563f08658b4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -37,7 +37,7 @@ public class NestedOneofToCheckValidationSemantics { public static class Schema01 extends NullJsonSchema {} - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -225,7 +225,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -361,8 +361,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -379,15 +379,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index 22dfa79caa8..56679959e52 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -37,7 +37,7 @@ public class Not { public static class Not2 extends IntJsonSchema {} - public static class Not1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Not1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -171,8 +171,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -189,15 +189,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 92f52766628..c678a7b718c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -38,8 +38,8 @@ public class NotMoreComplexSchema { public static class Foo extends StringJsonSchema {} - public static class NotMap extends FrozenMap { - protected NotMap(FrozenMap m) { + public static class NotMap extends FrozenMap<@Nullable Object> { + protected NotMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -87,7 +87,7 @@ public static Not getInstance() { } public NotMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -104,10 +104,10 @@ public NotMap getNewInstance(Map arg, List pathToItem, PathToSchem throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new NotMap(castProperties); } @@ -133,7 +133,7 @@ public NotMap validate(Map arg, SchemaConfiguration configuratio } - public static class NotMoreComplexSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NotMoreComplexSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -267,8 +267,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -285,15 +285,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index e3388572a7b..90a899d8550 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -42,8 +42,8 @@ public static class Foo extends IntJsonSchema {} public static class Bar extends StringJsonSchema {} - public static class ObjectPropertiesValidationMap extends FrozenMap { - protected ObjectPropertiesValidationMap(FrozenMap m) { + public static class ObjectPropertiesValidationMap extends FrozenMap<@Nullable Object> { + protected ObjectPropertiesValidationMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -216,7 +216,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public ObjectPropertiesValidationMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -233,10 +233,10 @@ public ObjectPropertiesValidationMap getNewInstance(Map arg, List throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new ObjectPropertiesValidationMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index a084aa2499c..92698af363d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -37,7 +37,7 @@ public class Oneof { public static class Schema0 extends IntJsonSchema {} - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -165,8 +165,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -183,15 +183,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -223,7 +223,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Oneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Oneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -360,8 +360,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -378,15 +378,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index 138b4bea6d8..bb7d6b1cfdf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -39,8 +39,8 @@ public class OneofComplexTypes { public static class Bar extends IntJsonSchema {} - public static class Schema0Map extends FrozenMap { - protected Schema0Map(FrozenMap m) { + public static class Schema0Map extends FrozenMap<@Nullable Object> { + protected Schema0Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -200,7 +200,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -217,10 +217,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); } @@ -260,8 +260,8 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur public static class Foo extends StringJsonSchema {} - public static class Schema1Map extends FrozenMap { - protected Schema1Map(FrozenMap m) { + public static class Schema1Map extends FrozenMap<@Nullable Object> { + protected Schema1Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -421,7 +421,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema1Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -438,10 +438,10 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema1Map(castProperties); } @@ -478,7 +478,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -615,8 +615,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -633,15 +633,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index 0dee7d73096..ef2c1fea454 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -33,7 +33,7 @@ public class OneofWithBaseSchema { // nest classes so all schemas and input/output classes can be public - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -161,8 +161,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -179,15 +179,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -219,7 +219,7 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -347,8 +347,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -365,15 +365,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 8eac7df1d20..404fc73cb9c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -41,7 +41,7 @@ public static class Schema0 extends NumberJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class OneofWithEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class OneofWithEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -178,8 +178,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -196,15 +196,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 62789a7633c..cee1884f379 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -33,8 +33,8 @@ public class OneofWithRequired { // nest classes so all schemas and input/output classes can be public - public static class Schema0Map extends FrozenMap { - protected Schema0Map(FrozenMap m) { + public static class Schema0Map extends FrozenMap<@Nullable Object> { + protected Schema0Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -197,7 +197,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema0Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -214,10 +214,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); } @@ -254,8 +254,8 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } } - public static class Schema1Map extends FrozenMap { - protected Schema1Map(FrozenMap m) { + public static class Schema1Map extends FrozenMap<@Nullable Object> { + protected Schema1Map(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -418,7 +418,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public Schema1Map getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -435,10 +435,10 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema1Map(castProperties); } @@ -475,7 +475,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class OneofWithRequired1 extends JsonSchema implements MapSchemaValidator> { + public static class OneofWithRequired1 extends JsonSchema implements MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -502,7 +502,7 @@ public static OneofWithRequired1 getInstance() { } public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -519,10 +519,10 @@ public static OneofWithRequired1 getInstance() { throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index 8a9792f07b7..0169346d271 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -34,7 +34,7 @@ public class PatternIsNotAnchored { // nest classes so all schemas and input/output classes can be public - public static class PatternIsNotAnchored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class PatternIsNotAnchored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -170,8 +170,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -188,15 +188,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index 0e90846adc4..982ef62d46d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -34,7 +34,7 @@ public class PatternValidation { // nest classes so all schemas and input/output classes can be public - public static class PatternValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class PatternValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -170,8 +170,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -188,15 +188,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index ce9e6fc9ba8..9e1cc08253f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -53,8 +53,8 @@ public static class Footbar extends NumberJsonSchema {} public static class Foofbar extends NumberJsonSchema {} - public static class PropertiesWithEscapedCharactersMap extends FrozenMap { - protected PropertiesWithEscapedCharactersMap(FrozenMap m) { + public static class PropertiesWithEscapedCharactersMap extends FrozenMap<@Nullable Object> { + protected PropertiesWithEscapedCharactersMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -223,7 +223,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -240,10 +240,10 @@ public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new PropertiesWithEscapedCharactersMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index b0a2edc975e..bb2ae3b847d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -38,8 +38,8 @@ public class PropertyNamedRefThatIsNotAReference { public static class Ref extends StringJsonSchema {} - public static class PropertyNamedRefThatIsNotAReferenceMap extends FrozenMap { - protected PropertyNamedRefThatIsNotAReferenceMap(FrozenMap m) { + public static class PropertyNamedRefThatIsNotAReferenceMap extends FrozenMap<@Nullable Object> { + protected PropertyNamedRefThatIsNotAReferenceMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -198,7 +198,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -215,10 +215,10 @@ public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new PropertyNamedRefThatIsNotAReferenceMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 544d641ae0b..11f8cafa5f3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -24,8 +24,8 @@ public class RefInAdditionalproperties { // nest classes so all schemas and input/output classes can be public - public static class RefInAdditionalpropertiesMap extends FrozenMap { - protected RefInAdditionalpropertiesMap(FrozenMap m) { + public static class RefInAdditionalpropertiesMap extends FrozenMap<@Nullable Object> { + protected RefInAdditionalpropertiesMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -34,7 +34,7 @@ public static RefInAdditionalpropertiesMap of(Map arg, SchemaCon return RefInAdditionalproperties1.getInstance().validate(arg, configuration); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) { throwIfKeyNotPresent(name); return get(name); } @@ -68,7 +68,7 @@ public static RefInAdditionalproperties1 getInstance() { } public RefInAdditionalpropertiesMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -85,10 +85,10 @@ public RefInAdditionalpropertiesMap getNewInstance(Map arg, List p throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RefInAdditionalpropertiesMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index 8331c0ae795..e1ad3fae39a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -33,7 +33,7 @@ public class RefInAllof { // nest classes so all schemas and input/output classes can be public - public static class RefInAllof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInAllof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -169,8 +169,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -187,15 +187,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index b78c919d796..bfb3527db43 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -33,7 +33,7 @@ public class RefInAnyof { // nest classes so all schemas and input/output classes can be public - public static class RefInAnyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInAnyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -169,8 +169,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -187,15 +187,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java index 88165ad97a1..5449ab89133 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java @@ -24,8 +24,8 @@ public class RefInItems { // nest classes so all schemas and input/output classes can be public - public static class RefInItemsList extends FrozenList { - protected RefInItemsList(FrozenList m) { + public static class RefInItemsList extends FrozenList<@Nullable Object> { + protected RefInItemsList(FrozenList<@Nullable Object> m) { super(m); } public static RefInItemsList of(List arg, SchemaConfiguration configuration) throws ValidationException { @@ -63,7 +63,7 @@ public static RefInItems1 getInstance() { @Override public RefInItemsList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + List<@Nullable Object> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -73,11 +73,11 @@ public RefInItemsList getNewInstance(List arg, List pathToItem, PathT throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - Object castItem = (Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); return new RefInItemsList(newInstanceItems); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index 2cbda1985c4..ae2aeefb9c5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -33,7 +33,7 @@ public class RefInNot { // nest classes so all schemas and input/output classes can be public - public static class RefInNot1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInNot1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index 54c31e85fe4..45f4d3b95d9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -33,7 +33,7 @@ public class RefInOneof { // nest classes so all schemas and input/output classes can be public - public static class RefInOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -169,8 +169,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -187,15 +187,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index ced22e79e17..fe81fc6e456 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -34,8 +34,8 @@ public class RefInProperty { // nest classes so all schemas and input/output classes can be public - public static class RefInPropertyMap extends FrozenMap { - protected RefInPropertyMap(FrozenMap m) { + public static class RefInPropertyMap extends FrozenMap<@Nullable Object> { + protected RefInPropertyMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -46,10 +46,10 @@ public static RefInPropertyMap of(Map arg, SchemaConfiguration c return RefInProperty1.getInstance().validate(arg, configuration); } - public Object a() { + public @Nullable Object a() { String key = "a"; throwIfKeyNotPresent(key); - return (Object) get(key); + return (@Nullable Object) get(key); } public Object getAdditionalProperty(String name) { @@ -200,7 +200,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public RefInPropertyMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -217,10 +217,10 @@ public RefInPropertyMap getNewInstance(Map arg, List pathToItem, P throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RefInPropertyMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 1f3ef01c8eb..66158341868 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -38,8 +38,8 @@ public class RequiredDefaultValidation { public static class Foo extends AnyTypeJsonSchema {} - public static class RequiredDefaultValidationMap extends FrozenMap { - protected RequiredDefaultValidationMap(FrozenMap m) { + public static class RequiredDefaultValidationMap extends FrozenMap<@Nullable Object> { + protected RequiredDefaultValidationMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -50,7 +50,7 @@ public static RequiredDefaultValidationMap of(Map arg, SchemaCon return RequiredDefaultValidation1.getInstance().validate(arg, configuration); } - public Object foo() { + public @Nullable Object foo() { String key = "foo"; throwIfKeyNotPresent(key); return get(key); @@ -204,7 +204,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public RequiredDefaultValidationMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -221,10 +221,10 @@ public RequiredDefaultValidationMap getNewInstance(Map arg, List p throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RequiredDefaultValidationMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index 3c9df38b4fa..b080ee6d87d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -41,8 +41,8 @@ public static class Foo extends AnyTypeJsonSchema {} public static class Bar extends AnyTypeJsonSchema {} - public static class RequiredValidationMap extends FrozenMap { - protected RequiredValidationMap(FrozenMap m) { + public static class RequiredValidationMap extends FrozenMap<@Nullable Object> { + protected RequiredValidationMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -55,11 +55,11 @@ public static RequiredValidationMap of(Map arg, SchemaConfigurat return RequiredValidation1.getInstance().validate(arg, configuration); } - public Object foo() { + public @Nullable Object foo() { return get("foo"); } - public Object bar() { + public @Nullable Object bar() { String key = "bar"; throwIfKeyNotPresent(key); return get(key); @@ -217,7 +217,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public RequiredValidationMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -234,10 +234,10 @@ public RequiredValidationMap getNewInstance(Map arg, List pathToIt throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RequiredValidationMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index 33cc6aa1478..cf5b4fc2cbf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -38,8 +38,8 @@ public class RequiredWithEmptyArray { public static class Foo extends AnyTypeJsonSchema {} - public static class RequiredWithEmptyArrayMap extends FrozenMap { - protected RequiredWithEmptyArrayMap(FrozenMap m) { + public static class RequiredWithEmptyArrayMap extends FrozenMap<@Nullable Object> { + protected RequiredWithEmptyArrayMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -50,7 +50,7 @@ public static RequiredWithEmptyArrayMap of(Map arg, SchemaConfig return RequiredWithEmptyArray1.getInstance().validate(arg, configuration); } - public Object foo() { + public @Nullable Object foo() { String key = "foo"; throwIfKeyNotPresent(key); return get(key); @@ -204,7 +204,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public RequiredWithEmptyArrayMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -221,10 +221,10 @@ public RequiredWithEmptyArrayMap getNewInstance(Map arg, List path throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RequiredWithEmptyArrayMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index ecdc06d3e56..d655a9c8ceb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -33,8 +33,8 @@ public class RequiredWithEscapedCharacters { // nest classes so all schemas and input/output classes can be public - public static class RequiredWithEscapedCharactersMap extends FrozenMap { - protected RequiredWithEscapedCharactersMap(FrozenMap m) { + public static class RequiredWithEscapedCharactersMap extends FrozenMap<@Nullable Object> { + protected RequiredWithEscapedCharactersMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of( @@ -203,7 +203,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -220,10 +220,10 @@ public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RequiredWithEscapedCharactersMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 89fe9231500..5ad9aa42eef 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -83,8 +83,8 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val } } - public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap extends FrozenMap { - protected TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap(FrozenMap m) { + public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap extends FrozenMap<@Nullable Object> { + protected TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap(FrozenMap<@Nullable Object> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -138,7 +138,7 @@ public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1 getInsta } public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -155,10 +155,10 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap getNewInstanc throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index f0f3e486e7b..ad5b45299cf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -33,7 +33,7 @@ public class UniqueitemsFalseValidation { // nest classes so all schemas and input/output classes can be public - public static class UniqueitemsFalseValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UniqueitemsFalseValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index af6eec8f9db..fcbd0ec32b4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -33,7 +33,7 @@ public class UniqueitemsValidation { // nest classes so all schemas and input/output classes can be public - public static class UniqueitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UniqueitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index a458a4e30d9..72a27e0c1b9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -33,7 +33,7 @@ public class UriFormat { // nest classes so all schemas and input/output classes can be public - public static class UriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index fa6288fe941..63b07040823 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -33,7 +33,7 @@ public class UriReferenceFormat { // nest classes so all schemas and input/output classes can be public - public static class UriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index 5f774959722..c1d8ed0ad43 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -33,7 +33,7 @@ public class UriTemplateFormat { // nest classes so all schemas and input/output classes can be public - public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -167,8 +167,8 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -185,15 +185,15 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Object castValue = (Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs index 59d096cddab..9a1fcce0686 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs @@ -97,7 +97,7 @@ long {{~/if}} {{/if}} {{else}} -FrozenList +FrozenList<@Nullable Object> {{~/if}} {{else}} {{#eq this "object"}} @@ -116,7 +116,7 @@ FrozenList {{~/if}} {{/if}} {{~else}} -FrozenMap +FrozenMap<@Nullable Object> {{~/if}} {{/eq}} {{/eq}} @@ -132,31 +132,31 @@ FrozenMap {{! nullable types }} {{#each types}} {{#eq this "boolean"}} -Boolean +@Nullable Boolean {{~else}} {{#eq this "string"}} {{#eq format "binary"}} {{! todo binary types}} -String +@Nullable String {{~else}} -String +@Nullable String {{~/eq}} {{else}} {{#eq this "number"}} {{#eq ../format null}} -Number +@Nullable Number {{~else}} {{#eq ../format "float"}} -Float +@Nullable Float {{~else}} {{#eq ../format "double"}} -Double +@Nullable Double {{~else}} {{#eq ../format "int32"}} -Integer +@Nullable Integer {{~else}} {{#eq ../format "int64"}} -Long +@Nullable Long {{~/eq}} {{/eq}} {{/eq}} @@ -165,13 +165,13 @@ Long {{else}} {{#eq this "integer"}} {{#eq ../format null}} -Long +@Nullable Long {{~else}} {{#eq ../format "int32"}} -Integer +@Nullable Integer {{~else}} {{#eq ../format "int64"}} -Long +@Nullable Long {{~/eq}} {{/eq}} {{/eq}} @@ -186,13 +186,13 @@ Long {{~/if}} {{else}} {{#if fullRefModule}} -{{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}} +@Nullable {{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}} {{~else}} -{{arrayOutputJsonPathPiece.camelCase}} +@Nullable {{arrayOutputJsonPathPiece.camelCase}} {{~/if}} {{/if}} {{else}} -FrozenList +@Nullable FrozenList<@Nullable Object> {{~/if}} {{else}} {{#eq this "object"}} @@ -205,13 +205,13 @@ FrozenList {{~/if}} {{else}} {{#if fullRefModule}} -{{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}} +@Nullable {{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}} {{~else}} -{{mapOutputJsonPathPiece.camelCase}} +@Nullable {{mapOutputJsonPathPiece.camelCase}} {{~/if}} {{/if}} {{~else}} -FrozenMap +@Nullable FrozenMap<@Nullable Object> {{~/if}} {{/eq}} {{/eq}} @@ -230,9 +230,13 @@ Object {{/contains}} {{else}} {{! 3 or more types }} + {{#contains types "null"}} +@Nullable Object + {{else}} Object + {{/contains}} {{~/eq}} {{/eq}} {{else}} -Object +@Nullable Object {{~/if}} From ca086b8bf754571d48f4fbf983e0072090926ec3 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 20:01:14 -0800 Subject: [PATCH 27/52] Adds throws exceptions to property getters --- ...propertiesAllowsASchemaWhichShouldValidate.java | 6 ++++-- .../AdditionalpropertiesAreAllowedByDefault.java | 7 ++++--- .../AdditionalpropertiesCanExistByItself.java | 2 ++ ...tionalpropertiesShouldNotLookInApplicators.java | 5 +++-- .../client/components/schemas/Allof.java | 5 +++-- .../components/schemas/AllofWithBaseSchema.java | 7 ++++--- .../components/schemas/AnyofComplexTypes.java | 5 +++-- .../components/schemas/EnumsInProperties.java | 6 ++++-- .../components/schemas/ForbiddenProperty.java | 5 +++-- .../schemas/InvalidStringValueForDefault.java | 5 +++-- .../components/schemas/NotMoreComplexSchema.java | 6 ++++-- .../schemas/ObjectPropertiesValidation.java | 7 ++++--- .../components/schemas/OneofComplexTypes.java | 5 +++-- .../components/schemas/OneofWithRequired.java | 14 ++++++++------ .../schemas/PropertiesWithEscapedCharacters.java | 3 ++- .../PropertyNamedRefThatIsNotAReference.java | 3 ++- .../schemas/RefInAdditionalproperties.java | 2 ++ .../client/components/schemas/RefInProperty.java | 5 +++-- .../schemas/RequiredDefaultValidation.java | 5 +++-- .../components/schemas/RequiredValidation.java | 5 +++-- .../components/schemas/RequiredWithEmptyArray.java | 5 +++-- .../schemas/RequiredWithEscapedCharacters.java | 2 +- ...ordDoesNotDoAnythingIfThePropertyIsMissing.java | 6 ++++-- .../codegen/generators/JavaClientGenerator.java | 5 +++++ .../components/schemas/_objectOutputProperties.hbs | 6 +++--- 25 files changed, 83 insertions(+), 49 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 378cb3f8c7c..7bbdb49eeac 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -11,7 +11,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.BooleanJsonSchema; @@ -49,13 +51,13 @@ public static AdditionalpropertiesAllowsASchemaWhichShouldValidateMap of(Map return AdditionalpropertiesAreAllowedByDefault1.getInstance().validate(arg, configuration); } - public @Nullable Object foo() { + public @Nullable Object foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); return get(key); } - public @Nullable Object bar() { + public @Nullable Object bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); return get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index fc4f823c2ea..e5396aa206d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -11,7 +11,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.BooleanJsonSchema; import org.openapijsonschematools.client.schemas.validation.FrozenMap; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index d4ed036b87c..4daf7d413ae 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.BooleanJsonSchema; @@ -54,13 +55,13 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu return Schema0.getInstance().validate(arg, configuration); } - public @Nullable Object foo() { + public @Nullable Object foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); return get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 07f034036d8..f8fd0f56b7b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.IntJsonSchema; import org.openapijsonschematools.client.schemas.StringJsonSchema; @@ -55,7 +56,7 @@ public long bar() { return (long) get("bar"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); @@ -276,7 +277,7 @@ public String foo() { return (String) get("foo"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index b25d8f38751..6c6df5c0381 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.IntJsonSchema; import org.openapijsonschematools.client.schemas.NullJsonSchema; @@ -56,7 +57,7 @@ public String foo() { return (String) get("foo"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); @@ -277,7 +278,7 @@ public Void baz() { return (Void) get("baz"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); @@ -498,7 +499,7 @@ public long bar() { return (long) get("bar"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 8fcba927fe5..c0dcb70f792 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.IntJsonSchema; import org.openapijsonschematools.client.schemas.StringJsonSchema; @@ -55,7 +56,7 @@ public long bar() { return (long) get("bar"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); @@ -276,7 +277,7 @@ public String foo() { return (String) get("foo"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index b4cf48edc8e..4b0df0a5c22 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -11,7 +11,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.SetMaker; import org.openapijsonschematools.client.schemas.validation.FrozenMap; @@ -127,13 +129,13 @@ public String bar() { return (String) get("bar"); } - public String foo() { + public String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); return (String) get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 6029dc9d01e..0c31727798f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; @@ -52,13 +53,13 @@ public static ForbiddenPropertyMap of(Map arg, SchemaConfigurati return ForbiddenProperty1.getInstance().validate(arg, configuration); } - public @Nullable Object foo() { + public @Nullable Object foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); return get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 17fa48cce42..de0b1bc1ed3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; @@ -85,13 +86,13 @@ public static InvalidStringValueForDefaultMap of(Map arg, Schema return InvalidStringValueForDefault1.getInstance().validate(arg, configuration); } - public String bar() { + public String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); return (String) get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index c678a7b718c..2ea30e71b83 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.StringJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; @@ -50,13 +52,13 @@ public static NotMap of(Map arg, SchemaConfiguration configurati return Not.getInstance().validate(arg, configuration); } - public String foo() { + public String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); return (String) get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index 90a899d8550..bae62a0f31d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.IntJsonSchema; import org.openapijsonschematools.client.schemas.StringJsonSchema; @@ -55,19 +56,19 @@ public static ObjectPropertiesValidationMap of(Map arg, SchemaCo return ObjectPropertiesValidation1.getInstance().validate(arg, configuration); } - public long foo() { + public long foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); return (long) get(key); } - public String bar() { + public String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); return (String) get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index bb7d6b1cfdf..583ad2d3cbd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.IntJsonSchema; import org.openapijsonschematools.client.schemas.StringJsonSchema; @@ -55,7 +56,7 @@ public long bar() { return (long) get("bar"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); @@ -276,7 +277,7 @@ public String foo() { return (String) get("foo"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index cee1884f379..b1cd8fbf98e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; @@ -46,15 +48,15 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu return Schema0.getInstance().validate(arg, configuration); } - public Object bar() { + public @Nullable Object bar() { return get("bar"); } - public Object foo() { + public @Nullable Object foo() { return get("foo"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); @@ -267,15 +269,15 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu return Schema1.getInstance().validate(arg, configuration); } - public Object baz() { + public @Nullable Object baz() { return get("baz"); } - public Object foo() { + public @Nullable Object foo() { return get("foo"); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 9e1cc08253f..5a73bdcdb44 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.NumberJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; @@ -70,7 +71,7 @@ public static PropertiesWithEscapedCharactersMap of(Map arg, Sch return PropertiesWithEscapedCharacters1.getInstance().validate(arg, configuration); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index bb2ae3b847d..1920f32297c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.StringJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; @@ -50,7 +51,7 @@ public static PropertyNamedRefThatIsNotAReferenceMap of(Map arg, return PropertyNamedRefThatIsNotAReference1.getInstance().validate(arg, configuration); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 11f8cafa5f3..184c169ae66 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -11,7 +11,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.FrozenMap; import org.openapijsonschematools.client.schemas.validation.JsonSchema; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index fe81fc6e456..3c137bd4f09 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; @@ -46,13 +47,13 @@ public static RefInPropertyMap of(Map arg, SchemaConfiguration c return RefInProperty1.getInstance().validate(arg, configuration); } - public @Nullable Object a() { + public @Nullable Object a() throws UnsetPropertyException { String key = "a"; throwIfKeyNotPresent(key); return (@Nullable Object) get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 66158341868..20358ea7642 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; @@ -50,13 +51,13 @@ public static RequiredDefaultValidationMap of(Map arg, SchemaCon return RequiredDefaultValidation1.getInstance().validate(arg, configuration); } - public @Nullable Object foo() { + public @Nullable Object foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); return get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index b080ee6d87d..8e8c88ff1e2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; @@ -59,13 +60,13 @@ public static RequiredValidationMap of(Map arg, SchemaConfigurat return get("foo"); } - public @Nullable Object bar() { + public @Nullable Object bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); return get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index cf5b4fc2cbf..bff3fb8c097 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -15,6 +15,7 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; @@ -50,13 +51,13 @@ public static RequiredWithEmptyArrayMap of(Map arg, SchemaConfig return RequiredWithEmptyArray1.getInstance().validate(arg, configuration); } - public @Nullable Object foo() { + public @Nullable Object foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); return get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index d655a9c8ceb..d8b91b374fd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -50,7 +50,7 @@ public static RequiredWithEscapedCharactersMap of(Map arg, Schem return RequiredWithEscapedCharacters1.getInstance().validate(arg, configuration); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 5ad9aa42eef..dcae2a940b8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -11,7 +11,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.FrozenMap; import org.openapijsonschematools.client.schemas.validation.JsonSchema; @@ -95,13 +97,13 @@ public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap of(Map return TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1.getInstance().validate(arg, configuration); } - public Number alpha() { + public Number alpha() throws UnsetPropertyException { String key = "alpha"; throwIfKeyNotPresent(key); return (Number) get(key); } - public Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { throwIfKeyKnown(name, requiredKeys, optionalKeys); throwIfKeyNotPresent(name); return get(name); diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java b/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java index c644005087d..625d339611c 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java @@ -1548,6 +1548,7 @@ private void addPropertiesValidator(CodegenSchema schema, Set imports) { imports.add("import "+packageName + ".schemas.validation.PropertyEntry;"); imports.add("import java.util.Map;"); imports.add("import java.util.Set;"); + imports.add("import "+packageName + ".exceptions.UnsetPropertyException;"); } } @@ -1627,6 +1628,10 @@ private void addMapSchemaImports(Set imports, CodegenSchema schema) { addAllOfValidator(schema, imports); addAnyOfValidator(schema, imports); addOneOfValidator(schema, imports); + if (schema.additionalProperties == null || !schema.additionalProperties.isBooleanSchemaFalse) { + imports.add("import "+packageName + ".exceptions.UnsetPropertyException;"); + imports.add("import "+packageName + ".exceptions.InvalidAdditionalPropertyException;"); + } } private void addListSchemaImports(Set imports, CodegenSchema schema) { diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs index 0127b817d96..9a4ab44384b 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs @@ -16,7 +16,7 @@ public {{> src/main/java/packagename/components/schemas/types/schema_output_type {{else}} {{! for when additionalProperties is unset, use OUTPUT_BASE_TYPES }} -public Object {{@key.original}}() { +public @Nullable Object {{@key.original}}() { {{> src/main/java/packagename/components/schemas/_objectOutputGetProperty required=true }} } {{/if}} @@ -30,7 +30,7 @@ public Object {{@key.original}}() { {{#if @key.isValid}} {{#with this}} -public {{> src/main/java/packagename/components/schemas/types/schema_output_type }} {{{@key.original}}}() { +public {{> src/main/java/packagename/components/schemas/types/schema_output_type }} {{{@key.original}}}() throws UnsetPropertyException { {{> src/main/java/packagename/components/schemas/_objectOutputGetProperty required=false }} } {{/with}} @@ -39,7 +39,7 @@ public {{> src/main/java/packagename/components/schemas/types/schema_output_type {{/if}} {{#eq additionalProperties null }} -public Object getAdditionalProperty(String name) { +public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { {{#or optionalProperties requiredProperties}} throwIfKeyKnown(name, requiredKeys, optionalKeys); {{/or}} From 8cc8be8d112f53c27d31650c19a996fd5dc33df4 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 20:18:16 -0800 Subject: [PATCH 28/52] Adds missing exception imports --- .../schemas/AdditionalpropertiesAreAllowedByDefault.java | 1 + .../AdditionalpropertiesShouldNotLookInApplicators.java | 1 + .../client/components/schemas/Allof.java | 1 + .../components/schemas/AllofCombinedWithAnyofOneof.java | 2 ++ .../client/components/schemas/AllofSimpleTypes.java | 2 ++ .../client/components/schemas/AllofWithBaseSchema.java | 1 + .../client/components/schemas/AllofWithOneEmptySchema.java | 2 ++ .../components/schemas/AllofWithTheFirstEmptySchema.java | 2 ++ .../components/schemas/AllofWithTheLastEmptySchema.java | 2 ++ .../client/components/schemas/AllofWithTwoEmptySchemas.java | 2 ++ .../client/components/schemas/Anyof.java | 2 ++ .../client/components/schemas/AnyofComplexTypes.java | 1 + .../client/components/schemas/AnyofWithBaseSchema.java | 2 ++ .../client/components/schemas/AnyofWithOneEmptySchema.java | 2 ++ .../client/components/schemas/ByInt.java | 2 ++ .../client/components/schemas/ByNumber.java | 2 ++ .../client/components/schemas/BySmallNumber.java | 2 ++ .../client/components/schemas/DateTimeFormat.java | 2 ++ .../client/components/schemas/EmailFormat.java | 2 ++ .../client/components/schemas/ForbiddenProperty.java | 1 + .../client/components/schemas/HostnameFormat.java | 2 ++ .../components/schemas/InvalidStringValueForDefault.java | 1 + .../client/components/schemas/Ipv4Format.java | 2 ++ .../client/components/schemas/Ipv6Format.java | 2 ++ .../client/components/schemas/JsonPointerFormat.java | 2 ++ .../client/components/schemas/MaximumValidation.java | 2 ++ .../schemas/MaximumValidationWithUnsignedInteger.java | 2 ++ .../client/components/schemas/MaxitemsValidation.java | 2 ++ .../client/components/schemas/MaxlengthValidation.java | 2 ++ .../schemas/Maxproperties0MeansTheObjectIsEmpty.java | 2 ++ .../client/components/schemas/MaxpropertiesValidation.java | 2 ++ .../client/components/schemas/MinimumValidation.java | 2 ++ .../schemas/MinimumValidationWithSignedInteger.java | 2 ++ .../client/components/schemas/MinitemsValidation.java | 2 ++ .../client/components/schemas/MinlengthValidation.java | 2 ++ .../client/components/schemas/MinpropertiesValidation.java | 2 ++ .../schemas/NestedAllofToCheckValidationSemantics.java | 2 ++ .../schemas/NestedAnyofToCheckValidationSemantics.java | 2 ++ .../schemas/NestedOneofToCheckValidationSemantics.java | 2 ++ .../openapijsonschematools/client/components/schemas/Not.java | 2 ++ .../client/components/schemas/ObjectPropertiesValidation.java | 1 + .../client/components/schemas/Oneof.java | 2 ++ .../client/components/schemas/OneofComplexTypes.java | 1 + .../client/components/schemas/OneofWithBaseSchema.java | 2 ++ .../client/components/schemas/OneofWithEmptySchema.java | 2 ++ .../client/components/schemas/PatternIsNotAnchored.java | 2 ++ .../client/components/schemas/PatternValidation.java | 2 ++ .../components/schemas/PropertiesWithEscapedCharacters.java | 1 + .../schemas/PropertyNamedRefThatIsNotAReference.java | 1 + .../client/components/schemas/RefInAllof.java | 2 ++ .../client/components/schemas/RefInAnyof.java | 2 ++ .../client/components/schemas/RefInNot.java | 2 ++ .../client/components/schemas/RefInOneof.java | 2 ++ .../client/components/schemas/RefInProperty.java | 1 + .../client/components/schemas/RequiredDefaultValidation.java | 1 + .../client/components/schemas/RequiredValidation.java | 1 + .../client/components/schemas/RequiredWithEmptyArray.java | 1 + .../components/schemas/RequiredWithEscapedCharacters.java | 2 ++ .../client/components/schemas/UniqueitemsFalseValidation.java | 2 ++ .../client/components/schemas/UniqueitemsValidation.java | 2 ++ .../client/components/schemas/UriFormat.java | 2 ++ .../client/components/schemas/UriReferenceFormat.java | 2 ++ .../client/components/schemas/UriTemplateFormat.java | 2 ++ .../codegen/generators/JavaClientGenerator.java | 4 ++++ 64 files changed, 115 insertions(+) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index b7bea617184..7c83fbea04b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index 4daf7d413ae..191536ab7d6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index f8fd0f56b7b..9c3192b7d7d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index 33943d41ae3..c99da6e7b9f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -15,7 +15,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index aae223a1cd1..c811b811c19 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 6c6df5c0381..0027f214a69 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index 0a2ecc8d800..9d81f4dc6ce 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 9028832886a..e0ab84def20 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.NumberJsonSchema; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 453ffa83ec7..c24d33d894e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.NumberJsonSchema; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index 27c6e99aef5..543c48443fc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index 46d342eb1e3..839e737f807 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.IntJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index c0dcb70f792..0123400c1de 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index e313bdd70a0..436d4874fb1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index bddb6ee4993..0f29785787a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.NumberJsonSchema; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 0d610c8803e..1e5bc7eea70 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -15,7 +15,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 42f1b8bf837..80a93e47498 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -15,7 +15,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index aecb3ef28c5..6ad9cfe92dc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -15,7 +15,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 1b15df51032..dce5f5c663e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index 44907e5d4de..b7a4f2f6038 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 0c31727798f..c80eaf304c6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 19e49503f5f..f8585cef8cf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index de0b1bc1ed3..3923833cf7d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index 381b3071929..00cfba04fe0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index 5f83d39ac5e..39510f23100 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index b2492545252..b0bb3783757 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 6536b088eb7..e3ed520cd32 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 0fc866aa132..05425f0d8c2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index e1b74cb11f5..c2c6e8e2d1b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 06e44575271..241d859175f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index 51f8c53b672..d2a017a8257 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index 245aa8bdb17..39f0c4f5d5d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index adbe606fe47..24942fb24de 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index 43fa9574acb..48c8a74e998 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index 3c84f900644..89b6c65abf3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 18ab065d429..53d56fd6bd6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index 40053563a9b..34e7d144b04 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 748e9703f69..83e57ae97a4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.NullJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index a65c4cf8ffc..a114dea27e0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.NullJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index 563f08658b4..d0e29069682 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.NullJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index 56679959e52..39b93dd7ab7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.IntJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index bae62a0f31d..a0fc976c9f5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index 92698af363d..b7270f04b2c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.IntJsonSchema; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index 583ad2d3cbd..3ed5218fe3c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index ef2c1fea454..400f787e5db 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 404fc73cb9c..96b06dfef5f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.NumberJsonSchema; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index 0169346d271..fa2b660aa61 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -15,7 +15,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index 982ef62d46d..9cb46dc0496 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -15,7 +15,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 5a73bdcdb44..87ba2755aa5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 1920f32297c..9b16b65ae17 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index e1ad3fae39a..9896ee9bfde 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index bfb3527db43..ad0b406b0c8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index ae2aeefb9c5..04209f96c54 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index 45f4d3b95d9..7d914808eb1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index 3c137bd4f09..ebc8bb1aba1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 20358ea7642..17523000dc2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index 8e8c88ff1e2..167fbcd3e7c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index bff3fb8c097..d31076d8015 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -14,6 +14,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index d8b91b374fd..cef6180d4ca 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index ad5b45299cf..d4762dc2cc5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index fcbd0ec32b4..52858488003 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index 72a27e0c1b9..9d691203da3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index 63b07040823..ebb01f6981a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index c1d8ed0ad43..96b9ae9c5bf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -14,7 +14,9 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.FrozenList; diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java b/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java index 625d339611c..4da076cc91a 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java @@ -1526,6 +1526,10 @@ public Set getImports(String sourceJsonPath, CodegenSchema schema, Featu if (schema.items != null) { imports.addAll(getDeeperImports(sourceJsonPath, schema.items)); } + if (schema.additionalProperties == null || !schema.additionalProperties.isBooleanSchemaFalse) { + imports.add("import "+packageName + ".exceptions.UnsetPropertyException;"); + imports.add("import "+packageName + ".exceptions.InvalidAdditionalPropertyException;"); + } } } return imports; From 2d6615ed900581655a26fb8abc3217c9dedaea21 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 20:51:31 -0800 Subject: [PATCH 29/52] Adds type checking protection for required and optional property getters --- .../client/components/schemas/Allof.java | 12 ++++++++++-- .../schemas/AllofWithBaseSchema.java | 18 +++++++++++++++--- .../components/schemas/AnyofComplexTypes.java | 12 ++++++++++-- .../components/schemas/EnumsInProperties.java | 12 ++++++++++-- .../schemas/InvalidStringValueForDefault.java | 6 +++++- .../schemas/NotMoreComplexSchema.java | 6 +++++- .../schemas/ObjectPropertiesValidation.java | 12 ++++++++++-- .../components/schemas/OneofComplexTypes.java | 12 ++++++++++-- .../components/schemas/RefInProperty.java | 6 +++++- ...oesNotDoAnythingIfThePropertyIsMissing.java | 6 +++++- .../schemas/_objectOutputGetProperty.hbs | 12 ++++++++++-- 11 files changed, 95 insertions(+), 19 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 9c3192b7d7d..154dc2b0a9e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -54,7 +54,11 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu } public long bar() { - return (long) get("bar"); + @Nullable Object value = get("bar"); + if (!(value instanceof Long)) { + throw new RuntimeException("Invalid value stored for bar"); + } + return (long) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -275,7 +279,11 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu } public String foo() { - return (String) get("foo"); + @Nullable Object value = get("foo"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for foo"); + } + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 0027f214a69..0c571c811ec 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -55,7 +55,11 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu } public String foo() { - return (String) get("foo"); + @Nullable Object value = get("foo"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for foo"); + } + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -276,7 +280,11 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu } public Void baz() { - return (Void) get("baz"); + @Nullable Object value = get("baz"); + if (!(value instanceof Void)) { + throw new RuntimeException("Invalid value stored for baz"); + } + return (Void) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -497,7 +505,11 @@ public static AllofWithBaseSchemaMap of(Map arg, SchemaConfigura } public long bar() { - return (long) get("bar"); + @Nullable Object value = get("bar"); + if (!(value instanceof Long)) { + throw new RuntimeException("Invalid value stored for bar"); + } + return (long) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 0123400c1de..4169d26e16d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -54,7 +54,11 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu } public long bar() { - return (long) get("bar"); + @Nullable Object value = get("bar"); + if (!(value instanceof Long)) { + throw new RuntimeException("Invalid value stored for bar"); + } + return (long) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -275,7 +279,11 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu } public String foo() { - return (String) get("foo"); + @Nullable Object value = get("foo"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for foo"); + } + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index 4b0df0a5c22..c5038001021 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -126,13 +126,21 @@ public static EnumsInPropertiesMap of(Map arg, SchemaConfigurati } public String bar() { - return (String) get("bar"); + @Nullable Object value = get("bar"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for bar"); + } + return (String) value; } public String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); - return (String) get(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for foo"); + } + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 3923833cf7d..7e790cf3429 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -90,7 +90,11 @@ public static InvalidStringValueForDefaultMap of(Map arg, Schema public String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); - return (String) get(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for bar"); + } + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 2ea30e71b83..941f58b52ce 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -55,7 +55,11 @@ public static NotMap of(Map arg, SchemaConfiguration configurati public String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); - return (String) get(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for foo"); + } + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index a0fc976c9f5..953e31c96aa 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -60,13 +60,21 @@ public static ObjectPropertiesValidationMap of(Map arg, SchemaCo public long foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); - return (long) get(key); + @Nullable Object value = get(key); + if (!(value instanceof Long)) { + throw new RuntimeException("Invalid value stored for foo"); + } + return (long) value; } public String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); - return (String) get(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for bar"); + } + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index 3ed5218fe3c..0af92bfbdfb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -54,7 +54,11 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu } public long bar() { - return (long) get("bar"); + @Nullable Object value = get("bar"); + if (!(value instanceof Long)) { + throw new RuntimeException("Invalid value stored for bar"); + } + return (long) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -275,7 +279,11 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu } public String foo() { - return (String) get("foo"); + @Nullable Object value = get("foo"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for foo"); + } + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index ebc8bb1aba1..b3075972ef4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -51,7 +51,11 @@ public static RefInPropertyMap of(Map arg, SchemaConfiguration c public @Nullable Object a() throws UnsetPropertyException { String key = "a"; throwIfKeyNotPresent(key); - return (@Nullable Object) get(key); + @Nullable Object value = get(key); + if (!(value instanceof @Nullable Object)) { + throw new RuntimeException("Invalid value stored for a"); + } + return (@Nullable Object) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index dcae2a940b8..cefbf222605 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -100,7 +100,11 @@ public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap of(Map public Number alpha() throws UnsetPropertyException { String key = "alpha"; throwIfKeyNotPresent(key); - return (Number) get(key); + @Nullable Object value = get(key); + if (!(value instanceof Number)) { + throw new RuntimeException("Invalid value stored for alpha"); + } + return (Number) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs index cc9b9325e85..950dd177e6f 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs @@ -2,7 +2,11 @@ {{#and ../../mapValueSchema (eq typeSchema ../../mapValueSchema.typeSchema) }} return get("{{{@key.original}}}"); {{else}} -return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) get("{{{@key.original}}}"); +{{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get("{{{@key.original}}}"); +if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true }})) { + throw new RuntimeException("Invalid value stored for {{{@key.original}}}"); +} +return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value; {{/and}} {{else}} String key = "{{{@key.original}}}"; @@ -10,6 +14,10 @@ throwIfKeyNotPresent(key); {{#and ../../mapValueSchema (eq typeSchema ../../mapValueSchema.typeSchema) }} return get(key); {{else}} -return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) get(key); +{{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get(key); +if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true }})) { + throw new RuntimeException("Invalid value stored for {{{@key.original}}}"); +} +return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value; {{/and}} {{/if}} From 0b7099e1eb9311f8780dd8ba148ba7588c32c033 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 20:59:54 -0800 Subject: [PATCH 30/52] Adds NonNull annotation for single outptu types --- .../AdditionalpropertiesCanExistByItself.md | 2 +- ...nalpropertiesShouldNotLookInApplicators.md | 2 +- .../java/docs/components/schemas/Allof.md | 2 +- .../components/schemas/AllofWithBaseSchema.md | 2 +- .../components/schemas/AnyofComplexTypes.md | 2 +- .../components/schemas/EnumsInProperties.md | 4 +- .../schemas/InvalidStringValueForDefault.md | 2 +- .../docs/components/schemas/NestedItems.md | 8 ++-- .../schemas/NotMoreComplexSchema.md | 2 +- .../schemas/ObjectPropertiesValidation.md | 2 +- .../components/schemas/OneofComplexTypes.md | 2 +- ...DoesNotDoAnythingIfThePropertyIsMissing.md | 2 +- .../AdditionalpropertiesCanExistByItself.java | 10 ++--- ...lpropertiesShouldNotLookInApplicators.java | 10 ++--- .../client/components/schemas/Allof.java | 8 ++-- .../schemas/AllofWithBaseSchema.java | 8 ++-- .../components/schemas/AnyofComplexTypes.java | 8 ++-- .../components/schemas/EnumsInProperties.java | 12 +++--- .../schemas/InvalidStringValueForDefault.java | 6 +-- .../components/schemas/NestedItems.java | 40 +++++++++---------- .../schemas/NotMoreComplexSchema.java | 6 +-- .../schemas/ObjectPropertiesValidation.java | 8 ++-- .../components/schemas/OneofComplexTypes.java | 8 ++-- ...esNotDoAnythingIfThePropertyIsMissing.java | 6 +-- .../types/_schema_output_type_base.hbs | 32 +++++++-------- 25 files changed, 97 insertions(+), 97 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md index 9f44bcd9bbd..9907a7c0886 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md @@ -71,7 +71,7 @@ A class that builds the Map input type ## AdditionalpropertiesCanExistByItselfMap public static class AdditionalpropertiesCanExistByItselfMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md index 528fe0a028b..d88c316026c 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md @@ -59,7 +59,7 @@ A class that builds the Map input type ## AdditionalpropertiesShouldNotLookInApplicatorsMap public static class AdditionalpropertiesShouldNotLookInApplicatorsMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md index 7791aefeacf..57906d86296 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md @@ -93,7 +93,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | -| String | foo()
| +| @NonNull String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md index 295dcfb4ef7..5d7350e9558 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md @@ -193,7 +193,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | -| String | foo()
| +| @NonNull String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md index 21921a7eb2c..dcee1548346 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md @@ -93,7 +93,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | -| String | foo()
| +| @NonNull String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md index 88d4b1d505b..e91156b0575 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md @@ -91,8 +91,8 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [EnumsInPropertiesMap](#enumsinpropertiesmap) | of([Map](#enumsinpropertiesmapinput) arg, SchemaConfiguration configuration) | -| String | bar()
must be one of ["bar"] | -| String | foo()
[optional] must be one of ["foo"] | +| @NonNull String | bar()
must be one of ["bar"] | +| @NonNull String | foo()
[optional] must be one of ["foo"] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Bar diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md index bbb7e03d06b..e6db3e1f47a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md @@ -63,7 +63,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [InvalidStringValueForDefaultMap](#invalidstringvaluefordefaultmap) | of([Map](#invalidstringvaluefordefaultmapinput) arg, SchemaConfiguration configuration) | -| String | bar()
[optional] if omitted the server will use the default value of bad | +| @NonNull String | bar()
[optional] if omitted the server will use the default value of bad | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Bar diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md index 3b7061133ae..31d3bdef2a8 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md @@ -87,7 +87,7 @@ List>> | | ## NestedItemsList public class NestedItemsList
-extends `FrozenList` +extends `FrozenList<@NonNull ItemsList2>` A class to store validated List payloads @@ -155,7 +155,7 @@ List> | | ## ItemsList2 public class ItemsList2
-extends `FrozenList` +extends `FrozenList<@NonNull ItemsList1>` A class to store validated List payloads @@ -221,7 +221,7 @@ List | | ## ItemsList1 public class ItemsList1
-extends `FrozenList` +extends `FrozenList<@NonNull ItemsList>` A class to store validated List payloads @@ -285,7 +285,7 @@ Number | | ## ItemsList public class ItemsList
-extends `FrozenList` +extends `FrozenList<@NonNull Number>` A class to store validated List payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md index 8d7270325bb..95a26af3823 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md @@ -109,7 +109,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [NotMap](#notmap) | of([Map](#notmapinput) arg, SchemaConfiguration configuration) | -| String | foo()
[optional] | +| @NonNull String | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md index 0dfbac98c39..8b627813573 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md @@ -66,7 +66,7 @@ A class to store validated Map payloads | ----------------- | ---------------------- | | static [ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) | of([Map](#objectpropertiesvalidationmapinput) arg, SchemaConfiguration configuration) | | long | foo()
[optional] | -| String | bar()
[optional] | +| @NonNull String | bar()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Bar diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md index 39f86c18df2..fe20f737807 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md @@ -93,7 +93,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | -| String | foo()
| +| @NonNull String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md index 973eaace1dc..58eb7267bf8 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md @@ -84,7 +84,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) | of([Map](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmapinput) arg, SchemaConfiguration configuration) | -| Number | alpha()
[optional] if omitted the server will use the default value of 5.0 | +| @NonNull Number | alpha()
[optional] if omitted the server will use the default value of 5.0 | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Alpha diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index e5396aa206d..706fb2a37a1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -30,8 +30,8 @@ public class AdditionalpropertiesCanExistByItself { public static class AdditionalProperties extends BooleanJsonSchema {} - public static class AdditionalpropertiesCanExistByItselfMap extends FrozenMap { - protected AdditionalpropertiesCanExistByItselfMap(FrozenMap m) { + public static class AdditionalpropertiesCanExistByItselfMap extends FrozenMap<@NonNull Boolean> { + protected AdditionalpropertiesCanExistByItselfMap(FrozenMap<@NonNull Boolean> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -74,7 +74,7 @@ public static AdditionalpropertiesCanExistByItself1 getInstance() { } public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -91,10 +91,10 @@ public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, Lis throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - Boolean castValue = (Boolean) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + @NonNull Boolean castValue = (@NonNull Boolean) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } - FrozenMap castProperties = new FrozenMap<>(properties); + FrozenMap<@NonNull Boolean> castProperties = new FrozenMap<>(properties); return new AdditionalpropertiesCanExistByItselfMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index 191536ab7d6..f22ad994834 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -261,8 +261,8 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } } - public static class AdditionalpropertiesShouldNotLookInApplicatorsMap extends FrozenMap { - protected AdditionalpropertiesShouldNotLookInApplicatorsMap(FrozenMap m) { + public static class AdditionalpropertiesShouldNotLookInApplicatorsMap extends FrozenMap<@NonNull Boolean> { + protected AdditionalpropertiesShouldNotLookInApplicatorsMap(FrozenMap<@NonNull Boolean> m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -419,7 +419,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public AdditionalpropertiesShouldNotLookInApplicatorsMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); @NonNull String propertyName; @@ -436,10 +436,10 @@ public AdditionalpropertiesShouldNotLookInApplicatorsMap getNewInstance(Map castProperties = new FrozenMap<>(properties); + FrozenMap<@NonNull Boolean> castProperties = new FrozenMap<>(properties); return new AdditionalpropertiesShouldNotLookInApplicatorsMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 154dc2b0a9e..59fe72d8db4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -55,7 +55,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu public long bar() { @Nullable Object value = get("bar"); - if (!(value instanceof Long)) { + if (!(value instanceof @NonNull Long)) { throw new RuntimeException("Invalid value stored for bar"); } return (long) value; @@ -278,12 +278,12 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu return Schema1.getInstance().validate(arg, configuration); } - public String foo() { + public @NonNull String foo() { @Nullable Object value = get("foo"); - if (!(value instanceof String)) { + if (!(value instanceof @NonNull String)) { throw new RuntimeException("Invalid value stored for foo"); } - return (String) value; + return (@NonNull String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 0c571c811ec..d9c8f4fe3c7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -54,12 +54,12 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu return Schema0.getInstance().validate(arg, configuration); } - public String foo() { + public @NonNull String foo() { @Nullable Object value = get("foo"); - if (!(value instanceof String)) { + if (!(value instanceof @NonNull String)) { throw new RuntimeException("Invalid value stored for foo"); } - return (String) value; + return (@NonNull String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -506,7 +506,7 @@ public static AllofWithBaseSchemaMap of(Map arg, SchemaConfigura public long bar() { @Nullable Object value = get("bar"); - if (!(value instanceof Long)) { + if (!(value instanceof @NonNull Long)) { throw new RuntimeException("Invalid value stored for bar"); } return (long) value; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 4169d26e16d..5ea6d998fe0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -55,7 +55,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu public long bar() { @Nullable Object value = get("bar"); - if (!(value instanceof Long)) { + if (!(value instanceof @NonNull Long)) { throw new RuntimeException("Invalid value stored for bar"); } return (long) value; @@ -278,12 +278,12 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu return Schema1.getInstance().validate(arg, configuration); } - public String foo() { + public @NonNull String foo() { @Nullable Object value = get("foo"); - if (!(value instanceof String)) { + if (!(value instanceof @NonNull String)) { throw new RuntimeException("Invalid value stored for foo"); } - return (String) value; + return (@NonNull String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index c5038001021..30cf677b907 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -125,22 +125,22 @@ public static EnumsInPropertiesMap of(Map arg, SchemaConfigurati return EnumsInProperties1.getInstance().validate(arg, configuration); } - public String bar() { + public @NonNull String bar() { @Nullable Object value = get("bar"); - if (!(value instanceof String)) { + if (!(value instanceof @NonNull String)) { throw new RuntimeException("Invalid value stored for bar"); } - return (String) value; + return (@NonNull String) value; } - public String foo() throws UnsetPropertyException { + public @NonNull String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); - if (!(value instanceof String)) { + if (!(value instanceof @NonNull String)) { throw new RuntimeException("Invalid value stored for foo"); } - return (String) value; + return (@NonNull String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 7e790cf3429..8e78a18d79c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -87,14 +87,14 @@ public static InvalidStringValueForDefaultMap of(Map arg, Schema return InvalidStringValueForDefault1.getInstance().validate(arg, configuration); } - public String bar() throws UnsetPropertyException { + public @NonNull String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); - if (!(value instanceof String)) { + if (!(value instanceof @NonNull String)) { throw new RuntimeException("Invalid value stored for bar"); } - return (String) value; + return (@NonNull String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index 620af47e4de..5325a2b5c54 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -28,8 +28,8 @@ public class NestedItems { public static class Items3 extends NumberJsonSchema {} - public static class ItemsList extends FrozenList { - protected ItemsList(FrozenList m) { + public static class ItemsList extends FrozenList<@NonNull Number> { + protected ItemsList(FrozenList<@NonNull Number> m) { super(m); } public static ItemsList of(List arg, SchemaConfiguration configuration) throws ValidationException { @@ -61,7 +61,7 @@ public static Items2 getInstance() { @Override public ItemsList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + List<@NonNull Number> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -71,11 +71,11 @@ public ItemsList getNewInstance(List arg, List pathToItem, PathToSche throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - Number castItem = (Number) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + @NonNull Number castItem = (@NonNull Number) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@NonNull Number> newInstanceItems = new FrozenList<>(items); return new ItemsList(newInstanceItems); } @@ -99,8 +99,8 @@ public ItemsList validate(List arg, SchemaConfiguration configuration) t } } - public static class ItemsList1 extends FrozenList { - protected ItemsList1(FrozenList m) { + public static class ItemsList1 extends FrozenList<@NonNull ItemsList> { + protected ItemsList1(FrozenList<@NonNull ItemsList> m) { super(m); } public static ItemsList1 of(List> arg, SchemaConfiguration configuration) throws ValidationException { @@ -132,7 +132,7 @@ public static Items1 getInstance() { @Override public ItemsList1 getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + List<@NonNull ItemsList> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -142,11 +142,11 @@ public ItemsList1 getNewInstance(List arg, List pathToItem, PathToSch throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - ItemsList castItem = (ItemsList) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + @NonNull ItemsList castItem = (@NonNull ItemsList) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@NonNull ItemsList> newInstanceItems = new FrozenList<>(items); return new ItemsList1(newInstanceItems); } @@ -170,8 +170,8 @@ public ItemsList1 validate(List> arg, SchemaConfiguration configura } } - public static class ItemsList2 extends FrozenList { - protected ItemsList2(FrozenList m) { + public static class ItemsList2 extends FrozenList<@NonNull ItemsList1> { + protected ItemsList2(FrozenList<@NonNull ItemsList1> m) { super(m); } public static ItemsList2 of(List>> arg, SchemaConfiguration configuration) throws ValidationException { @@ -203,7 +203,7 @@ public static Items getInstance() { @Override public ItemsList2 getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + List<@NonNull ItemsList1> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -213,11 +213,11 @@ public ItemsList2 getNewInstance(List arg, List pathToItem, PathToSch throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - ItemsList1 castItem = (ItemsList1) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + @NonNull ItemsList1 castItem = (@NonNull ItemsList1) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@NonNull ItemsList1> newInstanceItems = new FrozenList<>(items); return new ItemsList2(newInstanceItems); } @@ -241,8 +241,8 @@ public ItemsList2 validate(List>> arg, SchemaConfiguration con } } - public static class NestedItemsList extends FrozenList { - protected NestedItemsList(FrozenList m) { + public static class NestedItemsList extends FrozenList<@NonNull ItemsList2> { + protected NestedItemsList(FrozenList<@NonNull ItemsList2> m) { super(m); } public static NestedItemsList of(List>>> arg, SchemaConfiguration configuration) throws ValidationException { @@ -280,7 +280,7 @@ public static NestedItems1 getInstance() { @Override public NestedItemsList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + List<@NonNull ItemsList2> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -290,11 +290,11 @@ public NestedItemsList getNewInstance(List arg, List pathToItem, Path throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - ItemsList2 castItem = (ItemsList2) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + @NonNull ItemsList2 castItem = (@NonNull ItemsList2) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@NonNull ItemsList2> newInstanceItems = new FrozenList<>(items); return new NestedItemsList(newInstanceItems); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 941f58b52ce..137f8d62cfe 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -52,14 +52,14 @@ public static NotMap of(Map arg, SchemaConfiguration configurati return Not.getInstance().validate(arg, configuration); } - public String foo() throws UnsetPropertyException { + public @NonNull String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); - if (!(value instanceof String)) { + if (!(value instanceof @NonNull String)) { throw new RuntimeException("Invalid value stored for foo"); } - return (String) value; + return (@NonNull String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index 953e31c96aa..d06f4d21fe1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -61,20 +61,20 @@ public long foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); - if (!(value instanceof Long)) { + if (!(value instanceof @NonNull Long)) { throw new RuntimeException("Invalid value stored for foo"); } return (long) value; } - public String bar() throws UnsetPropertyException { + public @NonNull String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); - if (!(value instanceof String)) { + if (!(value instanceof @NonNull String)) { throw new RuntimeException("Invalid value stored for bar"); } - return (String) value; + return (@NonNull String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index 0af92bfbdfb..20a09c7dc9d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -55,7 +55,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu public long bar() { @Nullable Object value = get("bar"); - if (!(value instanceof Long)) { + if (!(value instanceof @NonNull Long)) { throw new RuntimeException("Invalid value stored for bar"); } return (long) value; @@ -278,12 +278,12 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu return Schema1.getInstance().validate(arg, configuration); } - public String foo() { + public @NonNull String foo() { @Nullable Object value = get("foo"); - if (!(value instanceof String)) { + if (!(value instanceof @NonNull String)) { throw new RuntimeException("Invalid value stored for foo"); } - return (String) value; + return (@NonNull String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index cefbf222605..530659bd5b0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -97,14 +97,14 @@ public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap of(Map return TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1.getInstance().validate(arg, configuration); } - public Number alpha() throws UnsetPropertyException { + public @NonNull Number alpha() throws UnsetPropertyException { String key = "alpha"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); - if (!(value instanceof Number)) { + if (!(value instanceof @NonNull Number)) { throw new RuntimeException("Invalid value stored for alpha"); } - return (Number) value; + return (@NonNull Number) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs index 9a1fcce0686..442ce4a8110 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs @@ -3,7 +3,7 @@ {{#each types}} {{#eq this "boolean"}} {{#if forceNull}} -Boolean +@NonNull Boolean {{~else}} boolean {{~/if}} @@ -16,37 +16,37 @@ Void {{! todo binary types}} String {{~else}} -String +@NonNull String {{~/eq}} {{else}} {{#eq this "number"}} {{#eq ../format null}} -Number +@NonNull Number {{~else}} {{#eq ../format "float"}} {{#if forceNull}} -Float +@NonNull Float {{~else}} float {{~/if}} {{else}} {{#eq ../format "double"}} {{#if forceNull}} -Double +@NonNull Double {{~else}} double {{~/if}} {{else}} {{#eq ../format "int32"}} {{#if forceNull}} -Integer +@NonNull Integer {{~else}} int {{~/if}} {{else}} {{#eq ../format "int64"}} {{#if forceNull}} -Long +@NonNull Long {{~else}} long {{~/if}} @@ -59,21 +59,21 @@ long {{#eq this "integer"}} {{#eq ../format null}} {{#if forceNull}} -Long +@NonNull Long {{~else}} long {{~/if}} {{else}} {{#eq ../format "int32"}} {{#if forceNull}} -Integer +@NonNull Integer {{~else}} int {{~/if}} {{else}} {{#eq ../format "int64"}} {{#if forceNull}} -Long +@NonNull Long {{~else}} long {{~/if}} @@ -91,13 +91,13 @@ long {{~/if}} {{else}} {{#if fullRefModule}} -{{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}} +@NonNull {{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}} {{~else}} -{{arrayOutputJsonPathPiece.camelCase}} +@NonNull {{arrayOutputJsonPathPiece.camelCase}} {{~/if}} {{/if}} {{else}} -FrozenList<@Nullable Object> +@NonNull FrozenList<@Nullable Object> {{~/if}} {{else}} {{#eq this "object"}} @@ -110,13 +110,13 @@ FrozenList<@Nullable Object> {{~/if}} {{else}} {{#if fullRefModule}} -{{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}} +@NonNull {{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}} {{~else}} -{{mapOutputJsonPathPiece.camelCase}} +@NonNull {{mapOutputJsonPathPiece.camelCase}} {{~/if}} {{/if}} {{~else}} -FrozenMap<@Nullable Object> +@NonNull FrozenMap<@Nullable Object> {{~/if}} {{/eq}} {{/eq}} From 66fea18e0599e100879078cb8e819f47d358c495 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 19 Dec 2023 21:38:33 -0800 Subject: [PATCH 31/52] Fixes throws signatures for getAdditionalProperty --- .../AdditionalpropertiesAllowsASchemaWhichShouldValidate.java | 3 ++- .../schemas/AdditionalpropertiesCanExistByItself.java | 2 +- .../AdditionalpropertiesShouldNotLookInApplicators.java | 2 +- .../client/components/schemas/RefInAdditionalproperties.java | 2 +- .../client/schemas/validation/FrozenMap.java | 2 +- .../components/schemas/_objectOutputProperties.hbs | 4 ++-- .../main/java/packagename/schemas/validation/FrozenMap.hbs | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 7bbdb49eeac..0e12d4350c4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -63,7 +63,8 @@ public static AdditionalpropertiesAllowsASchemaWhichShouldValidateMap of(Map ar return AdditionalpropertiesCanExistByItself1.getInstance().validate(arg, configuration); } - public boolean getAdditionalProperty(String name) { + public boolean getAdditionalProperty(String name) throws UnsetPropertyException { throwIfKeyNotPresent(name); return get(name); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index f22ad994834..100ff8858ec 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -271,7 +271,7 @@ public static AdditionalpropertiesShouldNotLookInApplicatorsMap of(Map arg, SchemaCon return RefInAdditionalproperties1.getInstance().validate(arg, configuration); } - public @Nullable Object getAdditionalProperty(String name) { + public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException { throwIfKeyNotPresent(name); return get(name); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java index 6a253967eaa..03ad5a13bb5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java @@ -30,7 +30,7 @@ protected void throwIfKeyNotPresent(String key) throws UnsetPropertyException { } } - protected void throwIfKeyKnown(String key, Set requiredKeys, Set optionalKeys) throws IllegalArgumentException { + protected void throwIfKeyKnown(String key, Set requiredKeys, Set optionalKeys) throws InvalidAdditionalPropertyException { if (requiredKeys.contains(key) || optionalKeys.contains(key)) { throw new InvalidAdditionalPropertyException ("The known key " + key + " may not be passed in when getting an additional property"); } diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs index 9a4ab44384b..d7b1b6e2466 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs @@ -50,8 +50,8 @@ public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyE {{#with additionalProperties}} {{#unless isBooleanSchemaFalse}} -public {{> src/main/java/packagename/components/schemas/types/schema_output_type }} getAdditionalProperty(String name) { - {{#or optionalProperties requiredProperties}} +public {{> src/main/java/packagename/components/schemas/types/schema_output_type }} getAdditionalProperty(String name) throws UnsetPropertyException{{#or ../optionalProperties ../requiredProperties}}, InvalidAdditionalPropertyException{{/or}} { + {{#or ../optionalProperties ../requiredProperties}} throwIfKeyKnown(name, requiredKeys, optionalKeys); {{/or}} throwIfKeyNotPresent(name); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs index 311cfbfba59..f96db564bf1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs @@ -30,7 +30,7 @@ public class FrozenMap extends AbstractMap { } } - protected void throwIfKeyKnown(String key, Set requiredKeys, Set optionalKeys) throws IllegalArgumentException { + protected void throwIfKeyKnown(String key, Set requiredKeys, Set optionalKeys) throws InvalidAdditionalPropertyException { if (requiredKeys.contains(key) || optionalKeys.contains(key)) { throw new InvalidAdditionalPropertyException ("The known key " + key + " may not be passed in when getting an additional property"); } From 527dd912bcccdafc5fd39ae6540686226df4b779 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 11:19:35 -0800 Subject: [PATCH 32/52] Removes annotations from instanceof checks --- ...rtiesAllowsASchemaWhichShouldValidate.java | 6 +- .../client/components/schemas/Allof.java | 4 +- .../schemas/AllofWithBaseSchema.java | 4 +- .../components/schemas/AnyofComplexTypes.java | 4 +- .../components/schemas/EnumsInProperties.java | 8 ++- .../schemas/InvalidStringValueForDefault.java | 6 +- .../schemas/NotMoreComplexSchema.java | 6 +- .../schemas/ObjectPropertiesValidation.java | 12 ++-- .../components/schemas/OneofComplexTypes.java | 4 +- .../components/schemas/RefInProperty.java | 6 +- ...esNotDoAnythingIfThePropertyIsMissing.java | 6 +- .../schemas/_objectOutputGetProperty.hbs | 6 +- .../schemas/_objectOutputProperties.hbs | 6 +- .../types/_schema_output_type_base.hbs | 70 +++++++++---------- 14 files changed, 86 insertions(+), 62 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 0e12d4350c4..45f5b9d72e1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -66,7 +66,11 @@ public static AdditionalpropertiesAllowsASchemaWhichShouldValidateMap of(Map arg, SchemaConfiguration configu public long bar() { @Nullable Object value = get("bar"); - if (!(value instanceof @NonNull Long)) { + if (!(value instanceof Long)) { throw new RuntimeException("Invalid value stored for bar"); } return (long) value; @@ -280,7 +280,7 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu public @NonNull String foo() { @Nullable Object value = get("foo"); - if (!(value instanceof @NonNull String)) { + if (!(value instanceof String)) { throw new RuntimeException("Invalid value stored for foo"); } return (@NonNull String) value; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index d9c8f4fe3c7..48ddc61a088 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -56,7 +56,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu public @NonNull String foo() { @Nullable Object value = get("foo"); - if (!(value instanceof @NonNull String)) { + if (!(value instanceof String)) { throw new RuntimeException("Invalid value stored for foo"); } return (@NonNull String) value; @@ -506,7 +506,7 @@ public static AllofWithBaseSchemaMap of(Map arg, SchemaConfigura public long bar() { @Nullable Object value = get("bar"); - if (!(value instanceof @NonNull Long)) { + if (!(value instanceof Long)) { throw new RuntimeException("Invalid value stored for bar"); } return (long) value; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 5ea6d998fe0..6780c7cf6a5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -55,7 +55,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu public long bar() { @Nullable Object value = get("bar"); - if (!(value instanceof @NonNull Long)) { + if (!(value instanceof Long)) { throw new RuntimeException("Invalid value stored for bar"); } return (long) value; @@ -280,7 +280,7 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu public @NonNull String foo() { @Nullable Object value = get("foo"); - if (!(value instanceof @NonNull String)) { + if (!(value instanceof String)) { throw new RuntimeException("Invalid value stored for foo"); } return (@NonNull String) value; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index 30cf677b907..ee06d74acb4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -127,7 +127,7 @@ public static EnumsInPropertiesMap of(Map arg, SchemaConfigurati public @NonNull String bar() { @Nullable Object value = get("bar"); - if (!(value instanceof @NonNull String)) { + if (!(value instanceof String)) { throw new RuntimeException("Invalid value stored for bar"); } return (@NonNull String) value; @@ -136,8 +136,10 @@ public static EnumsInPropertiesMap of(Map arg, SchemaConfigurati public @NonNull String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof @NonNull String)) { + // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[string], readOnly=null, writeOnly=null, nullable=null, allowableValues=org.openapijsonschematools.codegen.generators.openapimodels.EnumInfo@b5093a57, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + @Nullable Object value = get(key); + if (!(value instanceof String)) { throw new RuntimeException("Invalid value stored for foo"); } return (@NonNull String) value; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 8e78a18d79c..bae2cbd1400 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -90,8 +90,10 @@ public static InvalidStringValueForDefaultMap of(Map arg, Schema public @NonNull String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof @NonNull String)) { + // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[string], readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + @Nullable Object value = get(key); + if (!(value instanceof String)) { throw new RuntimeException("Invalid value stored for bar"); } return (@NonNull String) value; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 137f8d62cfe..64875188788 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -55,8 +55,10 @@ public static NotMap of(Map arg, SchemaConfiguration configurati public @NonNull String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof @NonNull String)) { + // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[string], readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + @Nullable Object value = get(key); + if (!(value instanceof String)) { throw new RuntimeException("Invalid value stored for foo"); } return (@NonNull String) value; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index d06f4d21fe1..4b9f5d2844f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -60,8 +60,10 @@ public static ObjectPropertiesValidationMap of(Map arg, SchemaCo public long foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof @NonNull Long)) { + // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[integer], readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + @Nullable Object value = get(key); + if (!(value instanceof Long)) { throw new RuntimeException("Invalid value stored for foo"); } return (long) value; @@ -70,8 +72,10 @@ public long foo() throws UnsetPropertyException { public @NonNull String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof @NonNull String)) { + // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[string], readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + @Nullable Object value = get(key); + if (!(value instanceof String)) { throw new RuntimeException("Invalid value stored for bar"); } return (@NonNull String) value; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index 20a09c7dc9d..fb934257905 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -55,7 +55,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu public long bar() { @Nullable Object value = get("bar"); - if (!(value instanceof @NonNull Long)) { + if (!(value instanceof Long)) { throw new RuntimeException("Invalid value stored for bar"); } return (long) value; @@ -280,7 +280,7 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu public @NonNull String foo() { @Nullable Object value = get("foo"); - if (!(value instanceof @NonNull String)) { + if (!(value instanceof String)) { throw new RuntimeException("Invalid value stored for foo"); } return (@NonNull String) value; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index b3075972ef4..ffe874489bd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -51,8 +51,10 @@ public static RefInPropertyMap of(Map arg, SchemaConfiguration c public @Nullable Object a() throws UnsetPropertyException { String key = "a"; throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof @Nullable Object)) { + // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=CodegenRefInfo{refModule=PropertyNamedRefThatIsNotAReference, refClass=PropertyNamedRefThatIsNotAReference1, refModuleLocation=org.openapijsonschematools.client.components.schemas, refModuleAlias=null}, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + @Nullable Object value = get(key); + if (!(value instanceof Object)) { throw new RuntimeException("Invalid value stored for a"); } return (@Nullable Object) value; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 530659bd5b0..4676546dab8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -100,8 +100,10 @@ public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap of(Map public @NonNull Number alpha() throws UnsetPropertyException { String key = "alpha"; throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof @NonNull Number)) { + // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[number], readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} + @Nullable Object value = get(key); + if (!(value instanceof Number)) { throw new RuntimeException("Invalid value stored for alpha"); } return (@NonNull Number) value; diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs index 950dd177e6f..1af0e50f338 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs @@ -3,7 +3,7 @@ return get("{{{@key.original}}}"); {{else}} {{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get("{{{@key.original}}}"); -if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true }})) { +if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true noAnnotations=true }})) { throw new RuntimeException("Invalid value stored for {{{@key.original}}}"); } return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value; @@ -14,8 +14,10 @@ throwIfKeyNotPresent(key); {{#and ../../mapValueSchema (eq typeSchema ../../mapValueSchema.typeSchema) }} return get(key); {{else}} +// mapValueSchema.typeSchema {{../../mapValueSchema.typeSchema}} +// typeSchema {{typeSchema}} {{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get(key); -if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true }})) { +if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true noAnnotations=true }})) { throw new RuntimeException("Invalid value stored for {{{@key.original}}}"); } return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value; diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs index d7b1b6e2466..a2e03f29597 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs @@ -58,7 +58,11 @@ public {{> src/main/java/packagename/components/schemas/types/schema_output_type {{#and ../../mapValueSchema (eq typeSchema ../../mapValueSchema.typeSchema) }} return get(name); {{else}} - return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) get(name); + {{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get(name); + if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true noAnnotations=true }})) { + throw new RuntimeException("Invalid value stored for " + name); + } + return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value; {{/and}} } {{/unless}} diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs index 442ce4a8110..26eef17dceb 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs @@ -3,7 +3,7 @@ {{#each types}} {{#eq this "boolean"}} {{#if forceNull}} -@NonNull Boolean +{{#unless noAnnotations}}@NonNull {{/unless}}Boolean {{~else}} boolean {{~/if}} @@ -16,37 +16,37 @@ Void {{! todo binary types}} String {{~else}} -@NonNull String +{{#unless noAnnotations}}@NonNull {{/unless}}String {{~/eq}} {{else}} {{#eq this "number"}} {{#eq ../format null}} -@NonNull Number +{{#unless noAnnotations}}@NonNull {{/unless}}Number {{~else}} {{#eq ../format "float"}} {{#if forceNull}} -@NonNull Float +{{#unless noAnnotations}}@NonNull {{/unless}}Float {{~else}} float {{~/if}} {{else}} {{#eq ../format "double"}} {{#if forceNull}} -@NonNull Double +{{#unless noAnnotations}}@NonNull {{/unless}}Double {{~else}} double {{~/if}} {{else}} {{#eq ../format "int32"}} {{#if forceNull}} -@NonNull Integer +{{#unless noAnnotations}}@NonNull {{/unless}}Integer {{~else}} int {{~/if}} {{else}} {{#eq ../format "int64"}} {{#if forceNull}} -@NonNull Long +{{#unless noAnnotations}}@NonNull {{/unless}}Long {{~else}} long {{~/if}} @@ -59,21 +59,21 @@ long {{#eq this "integer"}} {{#eq ../format null}} {{#if forceNull}} -@NonNull Long +{{#unless noAnnotations}}@NonNull {{/unless}}Long {{~else}} long {{~/if}} {{else}} {{#eq ../format "int32"}} {{#if forceNull}} -@NonNull Integer +{{#unless noAnnotations}}@NonNull {{/unless}}Integer {{~else}} int {{~/if}} {{else}} {{#eq ../format "int64"}} {{#if forceNull}} -@NonNull Long +{{#unless noAnnotations}}@NonNull {{/unless}}Long {{~else}} long {{~/if}} @@ -91,13 +91,13 @@ long {{~/if}} {{else}} {{#if fullRefModule}} -@NonNull {{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}} +{{#unless noAnnotations}}@NonNull {{/unless}}{{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}} {{~else}} -@NonNull {{arrayOutputJsonPathPiece.camelCase}} +{{#unless noAnnotations}}@NonNull {{/unless}}{{arrayOutputJsonPathPiece.camelCase}} {{~/if}} {{/if}} {{else}} -@NonNull FrozenList<@Nullable Object> +{{#unless noAnnotations}}@NonNull {{/unless}}FrozenList<@Nullable Object> {{~/if}} {{else}} {{#eq this "object"}} @@ -110,13 +110,13 @@ long {{~/if}} {{else}} {{#if fullRefModule}} -@NonNull {{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}} +{{#unless noAnnotations}}@NonNull {{/unless}}{{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}} {{~else}} -@NonNull {{mapOutputJsonPathPiece.camelCase}} +{{#unless noAnnotations}}@NonNull {{/unless}}{{mapOutputJsonPathPiece.camelCase}} {{~/if}} {{/if}} {{~else}} -@NonNull FrozenMap<@Nullable Object> +{{#unless noAnnotations}}@NonNull {{/unless}}FrozenMap<@Nullable Object> {{~/if}} {{/eq}} {{/eq}} @@ -132,31 +132,31 @@ long {{! nullable types }} {{#each types}} {{#eq this "boolean"}} -@Nullable Boolean +{{#unless noAnnotations}}@Nullable {{/unless}}Boolean {{~else}} {{#eq this "string"}} {{#eq format "binary"}} {{! todo binary types}} -@Nullable String +{{#unless noAnnotations}}@Nullable {{/unless}}String {{~else}} -@Nullable String +{{#unless noAnnotations}}@Nullable {{/unless}}String {{~/eq}} {{else}} {{#eq this "number"}} {{#eq ../format null}} -@Nullable Number +{{#unless noAnnotations}}@Nullable {{/unless}}Number {{~else}} {{#eq ../format "float"}} -@Nullable Float +{{#unless noAnnotations}}@Nullable {{/unless}}Float {{~else}} {{#eq ../format "double"}} -@Nullable Double +{{#unless noAnnotations}}@Nullable {{/unless}}Double {{~else}} {{#eq ../format "int32"}} -@Nullable Integer +{{#unless noAnnotations}}@Nullable {{/unless}}Integer {{~else}} {{#eq ../format "int64"}} -@Nullable Long +{{#unless noAnnotations}}@Nullable {{/unless}}Long {{~/eq}} {{/eq}} {{/eq}} @@ -165,13 +165,13 @@ long {{else}} {{#eq this "integer"}} {{#eq ../format null}} -@Nullable Long +{{#unless noAnnotations}}@Nullable {{/unless}}Long {{~else}} {{#eq ../format "int32"}} -@Nullable Integer +{{#unless noAnnotations}}@Nullable {{/unless}}Integer {{~else}} {{#eq ../format "int64"}} -@Nullable Long +{{#unless noAnnotations}}@Nullable {{/unless}}Long {{~/eq}} {{/eq}} {{/eq}} @@ -186,13 +186,13 @@ long {{~/if}} {{else}} {{#if fullRefModule}} -@Nullable {{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}} +{{#unless noAnnotations}}@Nullable {{/unless}}{{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}} {{~else}} -@Nullable {{arrayOutputJsonPathPiece.camelCase}} +{{#unless noAnnotations}}@Nullable {{/unless}}{{arrayOutputJsonPathPiece.camelCase}} {{~/if}} {{/if}} {{else}} -@Nullable FrozenList<@Nullable Object> +{{#unless noAnnotations}}@Nullable {{/unless}}FrozenList<@Nullable Object> {{~/if}} {{else}} {{#eq this "object"}} @@ -205,13 +205,13 @@ long {{~/if}} {{else}} {{#if fullRefModule}} -@Nullable {{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}} +{{#unless noAnnotations}}@Nullable {{/unless}}{{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}} {{~else}} -@Nullable {{mapOutputJsonPathPiece.camelCase}} +{{#unless noAnnotations}}@Nullable {{/unless}}{{mapOutputJsonPathPiece.camelCase}} {{~/if}} {{/if}} {{~else}} -@Nullable FrozenMap<@Nullable Object> +{{#unless noAnnotations}}@Nullable {{/unless}}FrozenMap<@Nullable Object> {{~/if}} {{/eq}} {{/eq}} @@ -231,12 +231,12 @@ Object {{else}} {{! 3 or more types }} {{#contains types "null"}} -@Nullable Object +{{#unless noAnnotations}}@Nullable {{/unless}}Object {{else}} Object {{/contains}} {{~/eq}} {{/eq}} {{else}} -@Nullable Object +{{#unless noAnnotations}}@Nullable {{/unless}}Object {{~/if}} From 956663a058ddae023b423b305b76b34eda55cc98 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 11:39:31 -0800 Subject: [PATCH 33/52] Removes else condition from if when checking key type --- ...rtiesAllowsASchemaWhichShouldValidate.java | 6 ++--- ...ditionalpropertiesAreAllowedByDefault.java | 6 ++--- .../AdditionalpropertiesCanExistByItself.java | 6 ++--- ...lpropertiesShouldNotLookInApplicators.java | 12 ++++------ .../client/components/schemas/Allof.java | 18 +++++--------- .../schemas/AllofCombinedWithAnyofOneof.java | 24 +++++++------------ .../components/schemas/AllofSimpleTypes.java | 18 +++++--------- .../schemas/AllofWithBaseSchema.java | 18 +++++--------- .../schemas/AllofWithOneEmptySchema.java | 6 ++--- .../schemas/AllofWithTheFirstEmptySchema.java | 6 ++--- .../schemas/AllofWithTheLastEmptySchema.java | 6 ++--- .../schemas/AllofWithTwoEmptySchemas.java | 6 ++--- .../client/components/schemas/Anyof.java | 12 ++++------ .../components/schemas/AnyofComplexTypes.java | 18 +++++--------- .../schemas/AnyofWithBaseSchema.java | 12 ++++------ .../schemas/AnyofWithOneEmptySchema.java | 6 ++--- .../client/components/schemas/ByInt.java | 6 ++--- .../client/components/schemas/ByNumber.java | 6 ++--- .../components/schemas/BySmallNumber.java | 6 ++--- .../components/schemas/DateTimeFormat.java | 6 ++--- .../components/schemas/EmailFormat.java | 6 ++--- .../components/schemas/EnumsInProperties.java | 6 ++--- .../components/schemas/ForbiddenProperty.java | 6 ++--- .../components/schemas/HostnameFormat.java | 6 ++--- .../schemas/InvalidStringValueForDefault.java | 6 ++--- .../client/components/schemas/Ipv4Format.java | 6 ++--- .../client/components/schemas/Ipv6Format.java | 6 ++--- .../components/schemas/JsonPointerFormat.java | 6 ++--- .../components/schemas/MaximumValidation.java | 6 ++--- .../MaximumValidationWithUnsignedInteger.java | 6 ++--- .../schemas/MaxitemsValidation.java | 6 ++--- .../schemas/MaxlengthValidation.java | 6 ++--- .../Maxproperties0MeansTheObjectIsEmpty.java | 6 ++--- .../schemas/MaxpropertiesValidation.java | 6 ++--- .../components/schemas/MinimumValidation.java | 6 ++--- .../MinimumValidationWithSignedInteger.java | 6 ++--- .../schemas/MinitemsValidation.java | 6 ++--- .../schemas/MinlengthValidation.java | 6 ++--- .../schemas/MinpropertiesValidation.java | 6 ++--- ...NestedAllofToCheckValidationSemantics.java | 12 ++++------ ...NestedAnyofToCheckValidationSemantics.java | 12 ++++------ ...NestedOneofToCheckValidationSemantics.java | 12 ++++------ .../client/components/schemas/Not.java | 6 ++--- .../schemas/NotMoreComplexSchema.java | 12 ++++------ .../schemas/ObjectPropertiesValidation.java | 6 ++--- .../client/components/schemas/Oneof.java | 12 ++++------ .../components/schemas/OneofComplexTypes.java | 18 +++++--------- .../schemas/OneofWithBaseSchema.java | 12 ++++------ .../schemas/OneofWithEmptySchema.java | 6 ++--- .../components/schemas/OneofWithRequired.java | 18 +++++--------- .../schemas/PatternIsNotAnchored.java | 6 ++--- .../components/schemas/PatternValidation.java | 6 ++--- .../PropertiesWithEscapedCharacters.java | 6 ++--- .../PropertyNamedRefThatIsNotAReference.java | 6 ++--- .../schemas/RefInAdditionalproperties.java | 6 ++--- .../client/components/schemas/RefInAllof.java | 6 ++--- .../client/components/schemas/RefInAnyof.java | 6 ++--- .../client/components/schemas/RefInNot.java | 6 ++--- .../client/components/schemas/RefInOneof.java | 6 ++--- .../components/schemas/RefInProperty.java | 6 ++--- .../schemas/RequiredDefaultValidation.java | 6 ++--- .../schemas/RequiredValidation.java | 6 ++--- .../schemas/RequiredWithEmptyArray.java | 6 ++--- .../RequiredWithEscapedCharacters.java | 6 ++--- ...esNotDoAnythingIfThePropertyIsMissing.java | 6 ++--- .../schemas/UniqueitemsFalseValidation.java | 6 ++--- .../schemas/UniqueitemsValidation.java | 6 ++--- .../client/components/schemas/UriFormat.java | 6 ++--- .../schemas/UriReferenceFormat.java | 6 ++--- .../components/schemas/UriTemplateFormat.java | 6 ++--- .../client/schemas/AnyTypeJsonSchema.java | 6 ++--- .../client/schemas/MapJsonSchema.java | 6 ++--- .../client/schemas/NotAnyTypeJsonSchema.java | 6 ++--- .../client/schemas/validation/JsonSchema.java | 6 ++--- .../validation/UnsetAnyTypeJsonSchema.java | 6 ++--- .../SchemaClass/_validate_implementor.hbs | 12 ++++------ .../packagename/schemas/AnyTypeJsonSchema.hbs | 6 ++--- .../packagename/schemas/MapJsonSchema.hbs | 6 ++--- .../schemas/NotAnyTypeJsonSchema.hbs | 6 ++--- .../schemas/validation/JsonSchema.hbs | 6 ++--- .../validation/UnsetAnyTypeJsonSchema.hbs | 6 ++--- 81 files changed, 212 insertions(+), 424 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 45f5b9d72e1..9c768e0d1c8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -109,12 +109,10 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap getNewInstance(Ma LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index 7c83fbea04b..94e72c3f868 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -220,12 +220,10 @@ public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index 907996d93b1..ec1840d339a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -77,12 +77,10 @@ public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, Lis LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index 100ff8858ec..e981a302ebe 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -207,12 +207,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -422,12 +420,10 @@ public AdditionalpropertiesShouldNotLookInApplicatorsMap getNewInstance(Map properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 322d2ef9c02..18e26b8b0d7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -209,12 +209,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -434,12 +432,10 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -629,12 +625,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index c99da6e7b9f..87af5a73a3f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -168,12 +168,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -354,12 +352,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -540,12 +536,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -740,12 +734,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index c811b811c19..d360d1a659d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -167,12 +167,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -353,12 +351,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -548,12 +544,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 48ddc61a088..99038045661 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -210,12 +210,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -435,12 +433,10 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -670,12 +666,10 @@ public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToI LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index 9d81f4dc6ce..83e3cf76531 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -179,12 +179,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index e0ab84def20..4ce3ac8e22a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -184,12 +184,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index c24d33d894e..02c6adbbf15 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -184,12 +184,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index 543c48443fc..b05edbf49c4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -183,12 +183,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index 839e737f807..ff23b5f2876 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -171,12 +171,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -366,12 +364,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 6780c7cf6a5..2101e5e75c6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -209,12 +209,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -434,12 +432,10 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -629,12 +625,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index 436d4874fb1..2603cd26c37 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -167,12 +167,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -353,12 +351,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index 0f29785787a..4f5967b622e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -184,12 +184,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 1e5bc7eea70..9afb6dbf270 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -174,12 +174,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 80a93e47498..faf77fdf468 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -174,12 +174,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index 6ad9cfe92dc..dfdfef0d6ad 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -174,12 +174,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index dce5f5c663e..315b5f35264 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index b7a4f2f6038..4204d428a3a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index ee06d74acb4..5ffc9b76349 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -189,12 +189,10 @@ public EnumsInPropertiesMap getNewInstance(Map arg, List pathToIte LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index c80eaf304c6..af79f4f70a8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -211,12 +211,10 @@ public ForbiddenPropertyMap getNewInstance(Map arg, List pathToIte LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index f8585cef8cf..e3a26dbb159 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index bae2cbd1400..57ae6982bd9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -250,12 +250,10 @@ public InvalidStringValueForDefaultMap getNewInstance(Map arg, List properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index 00cfba04fe0..c13ba696a23 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index 39510f23100..f79209060fb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index b0bb3783757..d534bda382b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index e3ed520cd32..484059cc053 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 05425f0d8c2..b430c791423 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index c2c6e8e2d1b..80e99d48552 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 241d859175f..d9b66c09b79 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index d2a017a8257..d7b5757aeb2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index 39f0c4f5d5d..c7e708fdba6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index 24942fb24de..03774d92e7b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index 48c8a74e998..ebd93e7fedf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index 89b6c65abf3..409568ce73f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 53d56fd6bd6..2ce31b42516 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index 34e7d144b04..1829dd06a60 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 83e57ae97a4..a082874867a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -367,12 +365,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index a114dea27e0..4495e4231cb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -367,12 +365,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index d0e29069682..f2b90b79964 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -367,12 +365,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index 39b93dd7ab7..d7821c84be0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -177,12 +177,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 64875188788..10dd259f179 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -98,12 +98,10 @@ public NotMap getNewInstance(Map arg, List pathToItem, PathToSchem LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -279,12 +277,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index 4b9f5d2844f..c64c052e46b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -233,12 +233,10 @@ public ObjectPropertiesValidationMap getNewInstance(Map arg, List LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index b7270f04b2c..d5f6a05c863 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -171,12 +171,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -366,12 +364,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index fb934257905..a118b7f3a11 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -209,12 +209,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -434,12 +432,10 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -629,12 +625,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index 400f787e5db..de5a939079f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -167,12 +167,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -353,12 +351,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 96b06dfef5f..6fe3bb43e01 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -184,12 +184,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index b1cd8fbf98e..6f437a8ac64 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -202,12 +202,10 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -423,12 +421,10 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -507,12 +503,10 @@ public static OneofWithRequired1 getInstance() { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index fa2b660aa61..cb79bb58e09 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -176,12 +176,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index 9cb46dc0496..dc45a8cbdc4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -176,12 +176,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 87ba2755aa5..d077b107eaa 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -228,12 +228,10 @@ public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 9b16b65ae17..07e1964e03d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -203,12 +203,10 @@ public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index ee0f72d05ee..b2a4d2e8b4c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -73,12 +73,10 @@ public RefInAdditionalpropertiesMap getNewInstance(Map arg, List p LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index 9896ee9bfde..be243e4ff72 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -175,12 +175,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index ad0b406b0c8..fbd48f417f1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -175,12 +175,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index 04209f96c54..48c9420e5a0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index 7d914808eb1..400ab0bb2b7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -175,12 +175,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index ffe874489bd..609cf0a74b9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -211,12 +211,10 @@ public RefInPropertyMap getNewInstance(Map arg, List pathToItem, P LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 17523000dc2..e68a5de538f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -209,12 +209,10 @@ public RequiredDefaultValidationMap getNewInstance(Map arg, List p LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index 167fbcd3e7c..ddf6b66ef88 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -222,12 +222,10 @@ public RequiredValidationMap getNewInstance(Map arg, List pathToIt LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index d31076d8015..f06f6529ed8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -209,12 +209,10 @@ public RequiredWithEmptyArrayMap getNewInstance(Map arg, List path LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index cef6180d4ca..827957897df 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -208,12 +208,10 @@ public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 4676546dab8..fc96d1c40e4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -149,12 +149,10 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap getNewInstanc LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index d4762dc2cc5..931daaea1fc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 52858488003..5edc34be225 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index 9d691203da3..524e9f58341 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index ebb01f6981a..639d456f44f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index 96b9ae9c5bf..eae239cbc7d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -173,12 +173,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index fd30e0b7f57..3515813e22b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -162,12 +162,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index 7f4126d3ff4..e1f2aa52e65 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -43,12 +43,10 @@ public static MapJsonSchema getInstance() { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index cd54708643f..4841eb8def7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -164,12 +164,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 806e47275b6..b68af658be3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -293,12 +293,10 @@ protected List castToAllowedTypes(List arg, List pathToItem, Set argFixed = new LinkedHashMap<>(); for (Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String key; - if (entryKey instanceof String) { - key = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String key = (@NonNull String) entryKey; Object val = entry.getValue(); List newPathToItem = new ArrayList<>(pathToItem); newPathToItem.add(key); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index f58829fd118..58ccf9dfb0d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -150,12 +150,10 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs index b71b8d3932c..b24f8dd3464 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs @@ -19,12 +19,10 @@ public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{ LinkedHashMap src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -348,12 +346,10 @@ public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else} LinkedHashMap src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs index 6d67f7e6136..950069208fa 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs @@ -162,12 +162,10 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs index 62b02cde8ef..0004d8ba3ba 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs @@ -43,12 +43,10 @@ public class MapJsonSchema extends JsonSchema implements MapSchemaValidator properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs index 256ce047423..48683125440 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs @@ -164,12 +164,10 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index c4e8d5dc2d7..9034b06ec3e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -293,12 +293,10 @@ public abstract class JsonSchema { LinkedHashMap argFixed = new LinkedHashMap<>(); for (Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String key; - if (entryKey instanceof String) { - key = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String key = (@NonNull String) entryKey; Object val = entry.getValue(); List newPathToItem = new ArrayList<>(pathToItem); newPathToItem.add(key); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs index 2ae68eefdca..32788a0ecd0 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs @@ -150,12 +150,10 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); - @NonNull String propertyName; - if (entryKey instanceof String) { - propertyName = (@NonNull String) entryKey; - } else { + if (!(entryKey instanceof String)) { throw new RuntimeException("Invalid non-string key value"); } + @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); From 58eca27864c98c852f9a3b988d1635751ea21151 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 12:09:08 -0800 Subject: [PATCH 34/52] Fixes type errors around property instantiation --- ...rtiesAllowsASchemaWhichShouldValidate.java | 7 +++-- ...ditionalpropertiesAreAllowedByDefault.java | 7 +++-- .../AdditionalpropertiesCanExistByItself.java | 7 +++-- ...lpropertiesShouldNotLookInApplicators.java | 14 +++++++--- .../client/components/schemas/Allof.java | 21 ++++++++++---- .../schemas/AllofCombinedWithAnyofOneof.java | 28 +++++++++++++------ .../components/schemas/AllofSimpleTypes.java | 21 ++++++++++---- .../schemas/AllofWithBaseSchema.java | 21 ++++++++++---- .../schemas/AllofWithOneEmptySchema.java | 7 +++-- .../schemas/AllofWithTheFirstEmptySchema.java | 7 +++-- .../schemas/AllofWithTheLastEmptySchema.java | 7 +++-- .../schemas/AllofWithTwoEmptySchemas.java | 7 +++-- .../client/components/schemas/Anyof.java | 14 +++++++--- .../components/schemas/AnyofComplexTypes.java | 21 ++++++++++---- .../schemas/AnyofWithBaseSchema.java | 14 +++++++--- .../schemas/AnyofWithOneEmptySchema.java | 7 +++-- .../client/components/schemas/ByInt.java | 7 +++-- .../client/components/schemas/ByNumber.java | 7 +++-- .../components/schemas/BySmallNumber.java | 7 +++-- .../components/schemas/DateTimeFormat.java | 7 +++-- .../components/schemas/EmailFormat.java | 7 +++-- .../components/schemas/EnumsInProperties.java | 7 +++-- .../components/schemas/ForbiddenProperty.java | 7 +++-- .../components/schemas/HostnameFormat.java | 7 +++-- .../schemas/InvalidStringValueForDefault.java | 7 +++-- .../client/components/schemas/Ipv4Format.java | 7 +++-- .../client/components/schemas/Ipv6Format.java | 7 +++-- .../components/schemas/JsonPointerFormat.java | 7 +++-- .../components/schemas/MaximumValidation.java | 7 +++-- .../MaximumValidationWithUnsignedInteger.java | 7 +++-- .../schemas/MaxitemsValidation.java | 7 +++-- .../schemas/MaxlengthValidation.java | 7 +++-- .../Maxproperties0MeansTheObjectIsEmpty.java | 7 +++-- .../schemas/MaxpropertiesValidation.java | 7 +++-- .../components/schemas/MinimumValidation.java | 7 +++-- .../MinimumValidationWithSignedInteger.java | 7 +++-- .../schemas/MinitemsValidation.java | 7 +++-- .../schemas/MinlengthValidation.java | 7 +++-- .../schemas/MinpropertiesValidation.java | 7 +++-- ...NestedAllofToCheckValidationSemantics.java | 14 +++++++--- ...NestedAnyofToCheckValidationSemantics.java | 14 +++++++--- ...NestedOneofToCheckValidationSemantics.java | 14 +++++++--- .../client/components/schemas/Not.java | 7 +++-- .../schemas/NotMoreComplexSchema.java | 14 +++++++--- .../schemas/ObjectPropertiesValidation.java | 7 +++-- .../client/components/schemas/Oneof.java | 14 +++++++--- .../components/schemas/OneofComplexTypes.java | 21 ++++++++++---- .../schemas/OneofWithBaseSchema.java | 14 +++++++--- .../schemas/OneofWithEmptySchema.java | 7 +++-- .../components/schemas/OneofWithRequired.java | 21 ++++++++++---- .../schemas/PatternIsNotAnchored.java | 7 +++-- .../components/schemas/PatternValidation.java | 7 +++-- .../PropertiesWithEscapedCharacters.java | 7 +++-- .../PropertyNamedRefThatIsNotAReference.java | 7 +++-- .../schemas/RefInAdditionalproperties.java | 7 +++-- .../client/components/schemas/RefInAllof.java | 7 +++-- .../client/components/schemas/RefInAnyof.java | 7 +++-- .../client/components/schemas/RefInNot.java | 7 +++-- .../client/components/schemas/RefInOneof.java | 7 +++-- .../components/schemas/RefInProperty.java | 7 +++-- .../schemas/RequiredDefaultValidation.java | 7 +++-- .../schemas/RequiredValidation.java | 7 +++-- .../schemas/RequiredWithEmptyArray.java | 7 +++-- .../RequiredWithEscapedCharacters.java | 7 +++-- ...esNotDoAnythingIfThePropertyIsMissing.java | 7 +++-- .../schemas/UniqueitemsFalseValidation.java | 7 +++-- .../schemas/UniqueitemsValidation.java | 7 +++-- .../client/components/schemas/UriFormat.java | 7 +++-- .../schemas/UriReferenceFormat.java | 7 +++-- .../components/schemas/UriTemplateFormat.java | 7 +++-- .../SchemaClass/_validate_implementor.hbs | 14 +++++++--- 71 files changed, 480 insertions(+), 192 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 9c768e0d1c8..1b5a3ce780e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -121,8 +121,11 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap getNewInstance(Ma throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new AdditionalpropertiesAllowsASchemaWhichShouldValidateMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index 94e72c3f868..a5394015ab0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -232,8 +232,11 @@ public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new AdditionalpropertiesAreAllowedByDefaultMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index ec1840d339a..94b8fd611a2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -89,8 +89,11 @@ public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, Lis throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @NonNull Boolean castValue = (@NonNull Boolean) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Boolean)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@NonNull Boolean) propertyInstance); } FrozenMap<@NonNull Boolean> castProperties = new FrozenMap<>(properties); return new AdditionalpropertiesCanExistByItselfMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index e981a302ebe..90be85cea66 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -219,8 +219,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); @@ -432,8 +435,11 @@ public AdditionalpropertiesShouldNotLookInApplicatorsMap getNewInstance(Map castProperties = new FrozenMap<>(properties); return new AdditionalpropertiesShouldNotLookInApplicatorsMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 18e26b8b0d7..aa0a70d8e87 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -221,8 +221,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); @@ -444,8 +447,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema1Map(castProperties); @@ -637,8 +643,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index 87af5a73a3f..2c9fc1d5931 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -180,8 +180,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -364,8 +367,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -548,8 +554,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -746,8 +755,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index d360d1a659d..b78ef79ae0b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -179,8 +179,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -363,8 +366,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -556,8 +562,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 99038045661..1fd5d2bfc5d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -222,8 +222,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); @@ -445,8 +448,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema1Map(castProperties); @@ -678,8 +684,11 @@ public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToI throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new AllofWithBaseSchemaMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index 83e3cf76531..37d0f2c5488 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -191,8 +191,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 4ce3ac8e22a..e5796ba30bc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -196,8 +196,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 02c6adbbf15..6d81f5534a6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -196,8 +196,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index b05edbf49c4..7b7ca4eca98 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -195,8 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index ff23b5f2876..e7d432b2a1d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -183,8 +183,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -376,8 +379,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 2101e5e75c6..fc3f5a890dd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -221,8 +221,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); @@ -444,8 +447,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema1Map(castProperties); @@ -637,8 +643,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index 2603cd26c37..2186d99dd3e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -179,8 +179,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -363,8 +366,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index 4f5967b622e..a6e5b30f66e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -196,8 +196,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 9afb6dbf270..c88c56d284b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -186,8 +186,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index faf77fdf468..480eab57154 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -186,8 +186,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index dfdfef0d6ad..fd09ac3fbfe 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -186,8 +186,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 315b5f35264..9df4d0ae04c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index 4204d428a3a..e029bb9212a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index 5ffc9b76349..618af90589a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -201,8 +201,11 @@ public EnumsInPropertiesMap getNewInstance(Map arg, List pathToIte throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new EnumsInPropertiesMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index af79f4f70a8..390831950f1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -223,8 +223,11 @@ public ForbiddenPropertyMap getNewInstance(Map arg, List pathToIte throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new ForbiddenPropertyMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index e3a26dbb159..330471a8499 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 57ae6982bd9..56b5c8b7224 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -262,8 +262,11 @@ public InvalidStringValueForDefaultMap getNewInstance(Map arg, List castProperties = new FrozenMap<>(properties); return new InvalidStringValueForDefaultMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index c13ba696a23..98ea293d5a9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index f79209060fb..1dcc49049f6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index d534bda382b..0b06b1c3be8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 484059cc053..5f4c19ebdd9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index b430c791423..b5386d65a41 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index 80e99d48552..a6ca8d80440 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index d9b66c09b79..33190486881 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index d7b5757aeb2..4dc1533ac0f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index c7e708fdba6..7958424fb4c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index 03774d92e7b..9de6910d19b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index ebd93e7fedf..3d6d22ebcd9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index 409568ce73f..c35425c613d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 2ce31b42516..dac4a25e062 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index 1829dd06a60..30024ca7b04 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index a082874867a..e081f8d70ee 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -377,8 +380,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index 4495e4231cb..3e77a4b07db 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -377,8 +380,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index f2b90b79964..b772fdbace4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -377,8 +380,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index d7821c84be0..b13b3a9221c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -189,8 +189,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 10dd259f179..64e1fad3c97 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -110,8 +110,11 @@ public NotMap getNewInstance(Map arg, List pathToItem, PathToSchem throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new NotMap(castProperties); @@ -289,8 +292,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index c64c052e46b..3e92be91209 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -245,8 +245,11 @@ public ObjectPropertiesValidationMap getNewInstance(Map arg, List throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new ObjectPropertiesValidationMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index d5f6a05c863..b295dfeb510 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -183,8 +183,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -376,8 +379,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index a118b7f3a11..109329f70ce 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -221,8 +221,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); @@ -444,8 +447,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema1Map(castProperties); @@ -637,8 +643,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index de5a939079f..f05c6ea3629 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -179,8 +179,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; @@ -363,8 +366,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 6fe3bb43e01..221d1f9e960 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -196,8 +196,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 6f437a8ac64..713b839f5bb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -214,8 +214,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema0Map(castProperties); @@ -433,8 +436,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new Schema1Map(castProperties); @@ -515,8 +521,11 @@ public static OneofWithRequired1 getInstance() { throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index cb79bb58e09..b4a93e79920 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -188,8 +188,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index dc45a8cbdc4..fb06b6955a2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -188,8 +188,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index d077b107eaa..b5be762b1ae 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -240,8 +240,11 @@ public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List castProperties = new FrozenMap<>(properties); return new PropertiesWithEscapedCharactersMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 07e1964e03d..63569a439cf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -215,8 +215,11 @@ public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new PropertyNamedRefThatIsNotAReferenceMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index b2a4d2e8b4c..63bb57e74a4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -85,8 +85,11 @@ public RefInAdditionalpropertiesMap getNewInstance(Map arg, List p throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RefInAdditionalpropertiesMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index be243e4ff72..c513e2b2b39 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -187,8 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index fbd48f417f1..4d455c9e0ac 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -187,8 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index 48c9420e5a0..181c616f231 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index 400ab0bb2b7..c078b67816a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -187,8 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index 609cf0a74b9..642279c0489 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -223,8 +223,11 @@ public RefInPropertyMap getNewInstance(Map arg, List pathToItem, P throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RefInPropertyMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index e68a5de538f..d1aa900af7c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -221,8 +221,11 @@ public RequiredDefaultValidationMap getNewInstance(Map arg, List p throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RequiredDefaultValidationMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index ddf6b66ef88..25d0621c29c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -234,8 +234,11 @@ public RequiredValidationMap getNewInstance(Map arg, List pathToIt throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RequiredValidationMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index f06f6529ed8..3f156218308 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -221,8 +221,11 @@ public RequiredWithEmptyArrayMap getNewInstance(Map arg, List path throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new RequiredWithEmptyArrayMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index 827957897df..5b042c5ca13 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -220,8 +220,11 @@ public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List castProperties = new FrozenMap<>(properties); return new RequiredWithEscapedCharactersMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index fc96d1c40e4..1e4a9459a55 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -161,8 +161,11 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap getNewInstanc throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return new TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap(castProperties); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index 931daaea1fc..08eb4d515d5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 5edc34be225..0a5a2674663 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index 524e9f58341..3b45ef0b65a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index 639d456f44f..a27869713a2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index eae239cbc7d..d7862ef07a8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castValue = (@Nullable Object) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); } FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); return castProperties; diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs index b24f8dd3464..ae548db38a7 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs @@ -31,8 +31,11 @@ public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{ throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - {{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}} castValue = ({{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof {{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true noAnnotations=true }}{{else}}Object{{/with}})) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, ({{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) propertyInstance); } FrozenMap<{{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> castProperties = new FrozenMap<>(properties); {{#if ../mapOutputJsonPathPiece}} @@ -358,8 +361,11 @@ public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else} throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - {{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}} castValue = ({{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof {{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true noAnnotations=true }}{{else}}Object{{/with}})) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, ({{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) propertyInstance); } FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> castProperties = new FrozenMap<>(properties); {{#if ../mapOutputJsonPathPiece}} From 58bac4e57485849f32eab1741a29ea3a4c3241c7 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 12:20:27 -0800 Subject: [PATCH 35/52] Fixes list item instantiation type errors --- ...ditionalpropertiesAreAllowedByDefault.java | 7 +++-- ...lpropertiesShouldNotLookInApplicators.java | 14 +++++++--- .../client/components/schemas/Allof.java | 21 ++++++++++---- .../schemas/AllofCombinedWithAnyofOneof.java | 28 +++++++++++++------ .../components/schemas/AllofSimpleTypes.java | 21 ++++++++++---- .../schemas/AllofWithBaseSchema.java | 21 ++++++++++---- .../schemas/AllofWithOneEmptySchema.java | 7 +++-- .../schemas/AllofWithTheFirstEmptySchema.java | 7 +++-- .../schemas/AllofWithTheLastEmptySchema.java | 7 +++-- .../schemas/AllofWithTwoEmptySchemas.java | 7 +++-- .../client/components/schemas/Anyof.java | 14 +++++++--- .../components/schemas/AnyofComplexTypes.java | 21 ++++++++++---- .../schemas/AnyofWithBaseSchema.java | 14 +++++++--- .../schemas/AnyofWithOneEmptySchema.java | 7 +++-- .../schemas/ArrayTypeMatchesArrays.java | 7 +++-- .../client/components/schemas/ByInt.java | 7 +++-- .../client/components/schemas/ByNumber.java | 7 +++-- .../components/schemas/BySmallNumber.java | 7 +++-- .../components/schemas/DateTimeFormat.java | 7 +++-- .../components/schemas/EmailFormat.java | 7 +++-- .../components/schemas/ForbiddenProperty.java | 7 +++-- .../components/schemas/HostnameFormat.java | 7 +++-- .../schemas/InvalidStringValueForDefault.java | 7 +++-- .../client/components/schemas/Ipv4Format.java | 7 +++-- .../client/components/schemas/Ipv6Format.java | 7 +++-- .../components/schemas/JsonPointerFormat.java | 7 +++-- .../components/schemas/MaximumValidation.java | 7 +++-- .../MaximumValidationWithUnsignedInteger.java | 7 +++-- .../schemas/MaxitemsValidation.java | 7 +++-- .../schemas/MaxlengthValidation.java | 7 +++-- .../Maxproperties0MeansTheObjectIsEmpty.java | 7 +++-- .../schemas/MaxpropertiesValidation.java | 7 +++-- .../components/schemas/MinimumValidation.java | 7 +++-- .../MinimumValidationWithSignedInteger.java | 7 +++-- .../schemas/MinitemsValidation.java | 7 +++-- .../schemas/MinlengthValidation.java | 7 +++-- .../schemas/MinpropertiesValidation.java | 7 +++-- ...NestedAllofToCheckValidationSemantics.java | 14 +++++++--- ...NestedAnyofToCheckValidationSemantics.java | 14 +++++++--- .../components/schemas/NestedItems.java | 28 +++++++++++++------ ...NestedOneofToCheckValidationSemantics.java | 14 +++++++--- .../client/components/schemas/Not.java | 7 +++-- .../schemas/NotMoreComplexSchema.java | 7 +++-- .../schemas/ObjectPropertiesValidation.java | 7 +++-- .../client/components/schemas/Oneof.java | 14 +++++++--- .../components/schemas/OneofComplexTypes.java | 21 ++++++++++---- .../schemas/OneofWithBaseSchema.java | 14 +++++++--- .../schemas/OneofWithEmptySchema.java | 7 +++-- .../components/schemas/OneofWithRequired.java | 14 +++++++--- .../schemas/PatternIsNotAnchored.java | 7 +++-- .../components/schemas/PatternValidation.java | 7 +++-- .../PropertiesWithEscapedCharacters.java | 7 +++-- .../PropertyNamedRefThatIsNotAReference.java | 7 +++-- .../client/components/schemas/RefInAllof.java | 7 +++-- .../client/components/schemas/RefInAnyof.java | 7 +++-- .../client/components/schemas/RefInItems.java | 7 +++-- .../client/components/schemas/RefInNot.java | 7 +++-- .../client/components/schemas/RefInOneof.java | 7 +++-- .../components/schemas/RefInProperty.java | 7 +++-- .../schemas/RequiredDefaultValidation.java | 7 +++-- .../schemas/RequiredValidation.java | 7 +++-- .../schemas/RequiredWithEmptyArray.java | 7 +++-- .../RequiredWithEscapedCharacters.java | 7 +++-- .../schemas/UniqueitemsFalseValidation.java | 7 +++-- .../schemas/UniqueitemsValidation.java | 7 +++-- .../client/components/schemas/UriFormat.java | 7 +++-- .../schemas/UriReferenceFormat.java | 7 +++-- .../components/schemas/UriTemplateFormat.java | 7 +++-- .../SchemaClass/_validate_implementor.hbs | 14 +++++++--- .../schemas/_objectOutputGetProperty.hbs | 2 -- 70 files changed, 475 insertions(+), 192 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index a5394015ab0..ce7896e73b0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -196,8 +196,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index 90be85cea66..0ad4212a9ce 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -183,8 +183,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -399,8 +402,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index aa0a70d8e87..6c4920ae672 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -411,8 +414,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -607,8 +613,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index 2c9fc1d5931..7f3ad3e9d02 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -144,8 +144,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -331,8 +334,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -518,8 +524,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -719,8 +728,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index b78ef79ae0b..ae8285d2944 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -143,8 +143,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -330,8 +333,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -526,8 +532,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 1fd5d2bfc5d..3bd1d469f83 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -186,8 +186,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -412,8 +415,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -648,8 +654,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index 37d0f2c5488..f39c72e3a17 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -155,8 +155,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index e5796ba30bc..226b93086ee 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -160,8 +160,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 6d81f5534a6..20314f5d988 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -160,8 +160,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index 7b7ca4eca98..73a1fa8061b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -159,8 +159,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index e7d432b2a1d..a7eefff894c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -147,8 +147,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -343,8 +346,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index fc3f5a890dd..834d96103e8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -411,8 +414,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -607,8 +613,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index 2186d99dd3e..59068656e0d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -143,8 +143,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -330,8 +333,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index a6e5b30f66e..323988147f5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -160,8 +160,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java index e0af052df8c..e55e1c08ba4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java @@ -77,8 +77,11 @@ public ArrayTypeMatchesArraysList getNewInstance(List arg, List pathT throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index c88c56d284b..d4203e66b2f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -150,8 +150,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 480eab57154..18543518825 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -150,8 +150,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index fd09ac3fbfe..f09c55be0c1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -150,8 +150,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 9df4d0ae04c..c2949f72fa7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index e029bb9212a..c1ee01b483c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 390831950f1..bafabbbf050 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -187,8 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 330471a8499..9300c277190 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 56b5c8b7224..f4d0f49b3cc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -226,8 +226,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index 98ea293d5a9..23381c5ea7f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index 1dcc49049f6..7e153a42e6a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 0b06b1c3be8..1834bfc8b1e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 5f4c19ebdd9..df4eb4851c1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index b5386d65a41..7a02690e587 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index a6ca8d80440..520b6076b53 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 33190486881..73a0402385f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index 4dc1533ac0f..efbde6b6dd7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index 7958424fb4c..3d8b8329a8e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index 9de6910d19b..6b6914e6e3f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index 3d6d22ebcd9..9c8e315b78b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index c35425c613d..4d601f73e4e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index dac4a25e062..3ae29db12cc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index 30024ca7b04..7d2d5d8e4a8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index e081f8d70ee..aaa6cf85e43 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -344,8 +347,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index 3e77a4b07db..776271760a3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -344,8 +347,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index 5325a2b5c54..5ecd825433f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -71,8 +71,11 @@ public ItemsList getNewInstance(List arg, List pathToItem, PathToSche throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @NonNull Number castItem = (@NonNull Number) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Number)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@NonNull Number) itemInstance); i += 1; } FrozenList<@NonNull Number> newInstanceItems = new FrozenList<>(items); @@ -142,8 +145,11 @@ public ItemsList1 getNewInstance(List arg, List pathToItem, PathToSch throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @NonNull ItemsList castItem = (@NonNull ItemsList) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof ItemsList)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@NonNull ItemsList) itemInstance); i += 1; } FrozenList<@NonNull ItemsList> newInstanceItems = new FrozenList<>(items); @@ -213,8 +219,11 @@ public ItemsList2 getNewInstance(List arg, List pathToItem, PathToSch throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @NonNull ItemsList1 castItem = (@NonNull ItemsList1) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof ItemsList1)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@NonNull ItemsList1) itemInstance); i += 1; } FrozenList<@NonNull ItemsList1> newInstanceItems = new FrozenList<>(items); @@ -290,8 +299,11 @@ public NestedItemsList getNewInstance(List arg, List pathToItem, Path throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @NonNull ItemsList2 castItem = (@NonNull ItemsList2) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof ItemsList2)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@NonNull ItemsList2) itemInstance); i += 1; } FrozenList<@NonNull ItemsList2> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index b772fdbace4..1e668912dfd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -344,8 +347,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index b13b3a9221c..5c65a95083c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -153,8 +153,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 64e1fad3c97..d1f7a112afa 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -256,8 +256,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index 3e92be91209..c72e9b02ec4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -209,8 +209,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index b295dfeb510..e852d1debd3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -147,8 +147,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -343,8 +346,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index 109329f70ce..b5426cfb639 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -411,8 +414,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -607,8 +613,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index f05c6ea3629..a9701ddda33 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -143,8 +143,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -330,8 +333,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 221d1f9e960..a2b03938b3c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -160,8 +160,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 713b839f5bb..0f7b5d5bf76 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -178,8 +178,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); @@ -400,8 +403,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index b4a93e79920..c9179465ba7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -152,8 +152,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index fb06b6955a2..a523a00a2cb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -152,8 +152,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index b5be762b1ae..022f3924b4f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -204,8 +204,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 63569a439cf..b27b450f527 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -179,8 +179,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index c513e2b2b39..141c7835f5a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -151,8 +151,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index 4d455c9e0ac..e5dbab36beb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -151,8 +151,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java index 5449ab89133..759f7c484a7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java @@ -73,8 +73,11 @@ public RefInItemsList getNewInstance(List arg, List pathToItem, PathT throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index 181c616f231..a45fd661e10 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index c078b67816a..e6c77b88c6f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -151,8 +151,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index 642279c0489..bd241c2ed66 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -187,8 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index d1aa900af7c..2462904aaea 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index 25d0621c29c..74f85a549cd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -198,8 +198,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index 3f156218308..d01c9489a8e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -185,8 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index 5b042c5ca13..88b0ffdd469 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -184,8 +184,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index 08eb4d515d5..99d2507d260 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 0a5a2674663..3decfedf129 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index 3b45ef0b65a..e91ff11d155 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index a27869713a2..b4ac4e2e3cb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index d7862ef07a8..6702fd404c6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -149,8 +149,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object castItem = (@Nullable Object) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add((@Nullable Object) itemInstance); i += 1; } FrozenList<@Nullable Object> newInstanceItems = new FrozenList<>(items); diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs index ae548db38a7..8c72bb284e0 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs @@ -71,8 +71,11 @@ public {{#if ../arrayOutputJsonPathPiece}}{{../arrayOutputJsonPathPiece.camelCas throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - {{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}} castItem = ({{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof {{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true noAnnotations=true }}{{else}}Object{{/with}})) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add(({{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) itemInstance); i += 1; } FrozenList<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> newInstanceItems = new FrozenList<>(items); @@ -321,8 +324,11 @@ public {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{e throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); - {{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}} castItem = ({{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(itemInstance instanceof {{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true noAnnotations=true }}{{else}}Object{{/with}})) { + throw new RuntimeException("Invalid instantiated value"); + } + items.add(({{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) itemInstance); i += 1; } FrozenList<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}> newInstanceItems = new FrozenList<>(items); diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs index 1af0e50f338..aab5970a66f 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs @@ -14,8 +14,6 @@ throwIfKeyNotPresent(key); {{#and ../../mapValueSchema (eq typeSchema ../../mapValueSchema.typeSchema) }} return get(key); {{else}} -// mapValueSchema.typeSchema {{../../mapValueSchema.typeSchema}} -// typeSchema {{typeSchema}} {{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get(key); if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true noAnnotations=true }})) { throw new RuntimeException("Invalid value stored for {{{@key.original}}}"); From 53da703767bd91281097b66a896e35435fdacae7 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 13:00:02 -0800 Subject: [PATCH 36/52] Changes RuntimeExceptions to InvalidTypeExceptions, fixes NullSchemaTest error --- ...rtiesAllowsASchemaWhichShouldValidate.java | 8 ++-- ...ditionalpropertiesAreAllowedByDefault.java | 10 ++--- .../AdditionalpropertiesCanExistByItself.java | 12 ++++-- ...lpropertiesShouldNotLookInApplicators.java | 26 +++++++----- .../client/components/schemas/Allof.java | 34 ++++++++-------- .../schemas/AllofCombinedWithAnyofOneof.java | 40 +++++++++---------- .../components/schemas/AllofSimpleTypes.java | 30 +++++++------- .../schemas/AllofWithBaseSchema.java | 36 ++++++++--------- .../schemas/AllofWithOneEmptySchema.java | 10 ++--- .../schemas/AllofWithTheFirstEmptySchema.java | 10 ++--- .../schemas/AllofWithTheLastEmptySchema.java | 10 ++--- .../schemas/AllofWithTwoEmptySchemas.java | 10 ++--- .../client/components/schemas/Anyof.java | 20 +++++----- .../components/schemas/AnyofComplexTypes.java | 34 ++++++++-------- .../schemas/AnyofWithBaseSchema.java | 20 +++++----- .../schemas/AnyofWithOneEmptySchema.java | 10 ++--- .../schemas/ArrayTypeMatchesArrays.java | 4 +- .../client/components/schemas/ByInt.java | 10 ++--- .../client/components/schemas/ByNumber.java | 10 ++--- .../components/schemas/BySmallNumber.java | 10 ++--- .../components/schemas/DateTimeFormat.java | 10 ++--- .../components/schemas/EmailFormat.java | 10 ++--- .../components/schemas/EnumsInProperties.java | 14 +++---- .../components/schemas/ForbiddenProperty.java | 10 ++--- .../components/schemas/HostnameFormat.java | 10 ++--- .../schemas/InvalidStringValueForDefault.java | 16 ++++---- .../client/components/schemas/Ipv4Format.java | 10 ++--- .../client/components/schemas/Ipv6Format.java | 10 ++--- .../components/schemas/JsonPointerFormat.java | 10 ++--- .../components/schemas/MaximumValidation.java | 10 ++--- .../MaximumValidationWithUnsignedInteger.java | 10 ++--- .../schemas/MaxitemsValidation.java | 10 ++--- .../schemas/MaxlengthValidation.java | 10 ++--- .../Maxproperties0MeansTheObjectIsEmpty.java | 10 ++--- .../schemas/MaxpropertiesValidation.java | 10 ++--- .../components/schemas/MinimumValidation.java | 10 ++--- .../MinimumValidationWithSignedInteger.java | 10 ++--- .../schemas/MinitemsValidation.java | 10 ++--- .../schemas/MinlengthValidation.java | 10 ++--- .../schemas/MinpropertiesValidation.java | 10 ++--- ...NestedAllofToCheckValidationSemantics.java | 20 +++++----- ...NestedAnyofToCheckValidationSemantics.java | 20 +++++----- .../components/schemas/NestedItems.java | 16 ++++---- ...NestedOneofToCheckValidationSemantics.java | 20 +++++----- .../client/components/schemas/Not.java | 10 ++--- .../schemas/NotMoreComplexSchema.java | 22 +++++----- .../schemas/ObjectPropertiesValidation.java | 22 +++++----- .../client/components/schemas/Oneof.java | 20 +++++----- .../components/schemas/OneofComplexTypes.java | 34 ++++++++-------- .../schemas/OneofWithBaseSchema.java | 20 +++++----- .../schemas/OneofWithEmptySchema.java | 10 ++--- .../components/schemas/OneofWithRequired.java | 26 ++++++------ .../schemas/PatternIsNotAnchored.java | 10 ++--- .../components/schemas/PatternValidation.java | 10 ++--- .../PropertiesWithEscapedCharacters.java | 10 ++--- .../PropertyNamedRefThatIsNotAReference.java | 10 ++--- .../schemas/RefInAdditionalproperties.java | 6 +-- .../client/components/schemas/RefInAllof.java | 10 ++--- .../client/components/schemas/RefInAnyof.java | 10 ++--- .../client/components/schemas/RefInItems.java | 4 +- .../client/components/schemas/RefInNot.java | 10 ++--- .../client/components/schemas/RefInOneof.java | 10 ++--- .../components/schemas/RefInProperty.java | 16 ++++---- .../schemas/RequiredDefaultValidation.java | 10 ++--- .../schemas/RequiredValidation.java | 10 ++--- .../schemas/RequiredWithEmptyArray.java | 10 ++--- .../RequiredWithEscapedCharacters.java | 10 ++--- ...esNotDoAnythingIfThePropertyIsMissing.java | 12 +++--- .../schemas/UniqueitemsFalseValidation.java | 10 ++--- .../schemas/UniqueitemsValidation.java | 10 ++--- .../client/components/schemas/UriFormat.java | 10 ++--- .../schemas/UriReferenceFormat.java | 10 ++--- .../components/schemas/UriTemplateFormat.java | 10 ++--- .../client/schemas/AnyTypeJsonSchema.java | 6 +-- .../client/schemas/ListJsonSchema.java | 2 +- .../client/schemas/MapJsonSchema.java | 4 +- .../client/schemas/NotAnyTypeJsonSchema.java | 6 +-- .../client/schemas/validation/JsonSchema.java | 2 +- .../validation/UnsetAnyTypeJsonSchema.java | 6 +-- .../client/schemas/NullSchemaTest.java | 1 + .../SchemaClass/_validate_implementor.hbs | 20 +++++----- .../schemas/_objectOutputGetProperty.hbs | 4 +- .../schemas/_objectOutputProperties.hbs | 10 ++++- .../packagename/schemas/AnyTypeJsonSchema.hbs | 6 +-- .../packagename/schemas/ListJsonSchema.hbs | 2 +- .../packagename/schemas/MapJsonSchema.hbs | 4 +- .../schemas/NotAnyTypeJsonSchema.hbs | 6 +-- .../schemas/validation/JsonSchema.hbs | 2 +- .../validation/UnsetAnyTypeJsonSchema.hbs | 6 +-- .../packagename/schemas/NullSchemaTest.hbs | 1 + 90 files changed, 552 insertions(+), 548 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 1b5a3ce780e..75f192b8815 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -68,7 +68,7 @@ public boolean getAdditionalProperty(String name) throws UnsetPropertyException, throwIfKeyNotPresent(name); @Nullable Object value = get(name); if (!(value instanceof Boolean)) { - throw new RuntimeException("Invalid value stored for " + name); + throw new InvalidTypeException("Invalid value stored for " + name); } return (boolean) value; } @@ -110,7 +110,7 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap getNewInstance(Ma for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -118,12 +118,12 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap getNewInstance(Ma Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index ce7896e73b0..fefbe6aa089 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -193,12 +193,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -224,7 +224,7 @@ public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -232,12 +232,12 @@ public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index 94b8fd611a2..e40f368eb4c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -42,7 +42,11 @@ public static AdditionalpropertiesCanExistByItselfMap of(Map ar public boolean getAdditionalProperty(String name) throws UnsetPropertyException { throwIfKeyNotPresent(name); - return get(name); + Boolean value = get(name); + if (value == null) { + throw new InvalidTypeException("Value may not be null"); + } + return (boolean) value; } } public static class AdditionalpropertiesCanExistByItselfMapInput { @@ -78,7 +82,7 @@ public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, Lis for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -86,12 +90,12 @@ public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, Lis Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Boolean)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@NonNull Boolean) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index 0ad4212a9ce..aea5474eeaf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -180,12 +180,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -211,7 +211,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -219,12 +219,12 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -277,7 +277,11 @@ public static AdditionalpropertiesShouldNotLookInApplicatorsMap of(Map schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -430,7 +434,7 @@ public AdditionalpropertiesShouldNotLookInApplicatorsMap getNewInstance(Map entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -438,12 +442,12 @@ public AdditionalpropertiesShouldNotLookInApplicatorsMap getNewInstance(Map schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Boolean)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@NonNull Boolean) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 6c4920ae672..633b379b5bc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -56,7 +56,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu public long bar() { @Nullable Object value = get("bar"); if (!(value instanceof Long)) { - throw new RuntimeException("Invalid value stored for bar"); + throw new InvalidTypeException("Invalid value stored for bar"); } return (long) value; } @@ -182,12 +182,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -213,7 +213,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -221,12 +221,12 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -285,7 +285,7 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu public @NonNull String foo() { @Nullable Object value = get("foo"); if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for foo"); + throw new InvalidTypeException("Invalid value stored for foo"); } return (@NonNull String) value; } @@ -411,12 +411,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -442,7 +442,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -450,12 +450,12 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -610,12 +610,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -641,7 +641,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -649,12 +649,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index 7f3ad3e9d02..985f0ce004a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -141,12 +141,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -172,7 +172,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -180,12 +180,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -331,12 +331,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -362,7 +362,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -370,12 +370,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -521,12 +521,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -552,7 +552,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -560,12 +560,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -725,12 +725,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -756,7 +756,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -764,12 +764,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index ae8285d2944..ed062d16197 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -140,12 +140,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -171,7 +171,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -179,12 +179,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -330,12 +330,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -361,7 +361,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -369,12 +369,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -529,12 +529,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -560,7 +560,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -568,12 +568,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 3bd1d469f83..ceeaebe85de 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -57,7 +57,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu public @NonNull String foo() { @Nullable Object value = get("foo"); if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for foo"); + throw new InvalidTypeException("Invalid value stored for foo"); } return (@NonNull String) value; } @@ -183,12 +183,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -214,7 +214,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -222,12 +222,12 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -286,7 +286,7 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu public Void baz() { @Nullable Object value = get("baz"); if (!(value instanceof Void)) { - throw new RuntimeException("Invalid value stored for baz"); + throw new InvalidTypeException("Invalid value stored for baz"); } return (Void) value; } @@ -412,12 +412,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -443,7 +443,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -451,12 +451,12 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -515,7 +515,7 @@ public static AllofWithBaseSchemaMap of(Map arg, SchemaConfigura public long bar() { @Nullable Object value = get("bar"); if (!(value instanceof Long)) { - throw new RuntimeException("Invalid value stored for bar"); + throw new InvalidTypeException("Invalid value stored for bar"); } return (long) value; } @@ -651,12 +651,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -682,7 +682,7 @@ public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToI for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -690,12 +690,12 @@ public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToI Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index f39c72e3a17..cc4eac209a8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -152,12 +152,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -183,7 +183,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -191,12 +191,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 226b93086ee..5791aa4e57c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -157,12 +157,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -188,7 +188,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -196,12 +196,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 20314f5d988..75b3847a46c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -157,12 +157,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -188,7 +188,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -196,12 +196,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index 73a1fa8061b..f04cbf1a3fe 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -156,12 +156,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -187,7 +187,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -195,12 +195,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index a7eefff894c..01a3e10347e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -144,12 +144,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -175,7 +175,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -183,12 +183,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -343,12 +343,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -374,7 +374,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -382,12 +382,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 834d96103e8..ffc750b6b19 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -56,7 +56,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu public long bar() { @Nullable Object value = get("bar"); if (!(value instanceof Long)) { - throw new RuntimeException("Invalid value stored for bar"); + throw new InvalidTypeException("Invalid value stored for bar"); } return (long) value; } @@ -182,12 +182,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -213,7 +213,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -221,12 +221,12 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -285,7 +285,7 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu public @NonNull String foo() { @Nullable Object value = get("foo"); if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for foo"); + throw new InvalidTypeException("Invalid value stored for foo"); } return (@NonNull String) value; } @@ -411,12 +411,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -442,7 +442,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -450,12 +450,12 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -610,12 +610,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -641,7 +641,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -649,12 +649,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index 59068656e0d..039423d6f38 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -140,12 +140,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -171,7 +171,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -179,12 +179,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -330,12 +330,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -361,7 +361,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -369,12 +369,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index 323988147f5..db218f6e44f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -157,12 +157,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -188,7 +188,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -196,12 +196,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java index e55e1c08ba4..e86b1436d8c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java @@ -74,12 +74,12 @@ public ArrayTypeMatchesArraysList getNewInstance(List arg, List pathT itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index d4203e66b2f..4f1ba6bd122 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -147,12 +147,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -178,7 +178,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -186,12 +186,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 18543518825..7f18ba05c1c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -147,12 +147,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -178,7 +178,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -186,12 +186,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index f09c55be0c1..023f1a883d0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -147,12 +147,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -178,7 +178,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -186,12 +186,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index c2949f72fa7..409a26fafe2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index c1ee01b483c..11f91cafedf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index 618af90589a..94e1a9cde9a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -128,7 +128,7 @@ public static EnumsInPropertiesMap of(Map arg, SchemaConfigurati public @NonNull String bar() { @Nullable Object value = get("bar"); if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for bar"); + throw new InvalidTypeException("Invalid value stored for bar"); } return (@NonNull String) value; } @@ -136,11 +136,9 @@ public static EnumsInPropertiesMap of(Map arg, SchemaConfigurati public @NonNull String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); - // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[string], readOnly=null, writeOnly=null, nullable=null, allowableValues=org.openapijsonschematools.codegen.generators.openapimodels.EnumInfo@b5093a57, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - @Nullable Object value = get(key); + @Nullable Object value = get(key); if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for foo"); + throw new InvalidTypeException("Invalid value stored for foo"); } return (@NonNull String) value; } @@ -190,7 +188,7 @@ public EnumsInPropertiesMap getNewInstance(Map arg, List pathToIte for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -198,12 +196,12 @@ public EnumsInPropertiesMap getNewInstance(Map arg, List pathToIte Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index bafabbbf050..d9a3785cd08 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -184,12 +184,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -215,7 +215,7 @@ public ForbiddenPropertyMap getNewInstance(Map arg, List pathToIte for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -223,12 +223,12 @@ public ForbiddenPropertyMap getNewInstance(Map arg, List pathToIte Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 9300c277190..9c3c2bc9c2f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index f4d0f49b3cc..6bc02f0d848 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -90,11 +90,9 @@ public static InvalidStringValueForDefaultMap of(Map arg, Schema public @NonNull String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); - // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[string], readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - @Nullable Object value = get(key); + @Nullable Object value = get(key); if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for bar"); + throw new InvalidTypeException("Invalid value stored for bar"); } return (@NonNull String) value; } @@ -223,12 +221,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -254,7 +252,7 @@ public InvalidStringValueForDefaultMap getNewInstance(Map arg, List entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -262,12 +260,12 @@ public InvalidStringValueForDefaultMap getNewInstance(Map arg, List schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index 23381c5ea7f..ab6f8d4a68e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index 7e153a42e6a..cf95bc0933a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 1834bfc8b1e..9227df3d7a4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index df4eb4851c1..2637c207843 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 7a02690e587..4a9ce87c5a1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index 520b6076b53..664f9260a50 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 73a0402385f..05563ce9be8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index efbde6b6dd7..e4f2f57c7c3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index 3d8b8329a8e..8c99a6dc13d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index 6b6914e6e3f..de1025d65b7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index 9c8e315b78b..96e2fcd1169 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index 4d601f73e4e..b0155206030 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 3ae29db12cc..466023d8008 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index 7d2d5d8e4a8..d747881a33d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index aaa6cf85e43..cfd253c2747 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -344,12 +344,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -375,7 +375,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -383,12 +383,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index 776271760a3..212558c4e74 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -344,12 +344,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -375,7 +375,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -383,12 +383,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index 5ecd825433f..369938e9c45 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -68,12 +68,12 @@ public ItemsList getNewInstance(List arg, List pathToItem, PathToSche itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Number)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@NonNull Number) itemInstance); i += 1; @@ -142,12 +142,12 @@ public ItemsList1 getNewInstance(List arg, List pathToItem, PathToSch itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@NonNull ItemsList) itemInstance); i += 1; @@ -216,12 +216,12 @@ public ItemsList2 getNewInstance(List arg, List pathToItem, PathToSch itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList1)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@NonNull ItemsList1) itemInstance); i += 1; @@ -296,12 +296,12 @@ public NestedItemsList getNewInstance(List arg, List pathToItem, Path itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList2)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@NonNull ItemsList2) itemInstance); i += 1; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index 1e668912dfd..80437b11560 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -344,12 +344,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -375,7 +375,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -383,12 +383,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index 5c65a95083c..7c406860a72 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -150,12 +150,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -181,7 +181,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -189,12 +189,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index d1f7a112afa..8a94b8808da 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -55,11 +55,9 @@ public static NotMap of(Map arg, SchemaConfiguration configurati public @NonNull String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); - // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[string], readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - @Nullable Object value = get(key); + @Nullable Object value = get(key); if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for foo"); + throw new InvalidTypeException("Invalid value stored for foo"); } return (@NonNull String) value; } @@ -99,7 +97,7 @@ public NotMap getNewInstance(Map arg, List pathToItem, PathToSchem for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -107,12 +105,12 @@ public NotMap getNewInstance(Map arg, List pathToItem, PathToSchem Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -253,12 +251,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -284,7 +282,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -292,12 +290,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index c72e9b02ec4..1d7dd383904 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -60,11 +60,9 @@ public static ObjectPropertiesValidationMap of(Map arg, SchemaCo public long foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); - // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[integer], readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - @Nullable Object value = get(key); + @Nullable Object value = get(key); if (!(value instanceof Long)) { - throw new RuntimeException("Invalid value stored for foo"); + throw new InvalidTypeException("Invalid value stored for foo"); } return (long) value; } @@ -72,11 +70,9 @@ public long foo() throws UnsetPropertyException { public @NonNull String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); - // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[string], readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - @Nullable Object value = get(key); + @Nullable Object value = get(key); if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for bar"); + throw new InvalidTypeException("Invalid value stored for bar"); } return (@NonNull String) value; } @@ -206,12 +202,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -237,7 +233,7 @@ public ObjectPropertiesValidationMap getNewInstance(Map arg, List for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -245,12 +241,12 @@ public ObjectPropertiesValidationMap getNewInstance(Map arg, List Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index e852d1debd3..8662d6b473d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -144,12 +144,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -175,7 +175,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -183,12 +183,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -343,12 +343,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -374,7 +374,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -382,12 +382,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index b5426cfb639..fcb9eb76185 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -56,7 +56,7 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu public long bar() { @Nullable Object value = get("bar"); if (!(value instanceof Long)) { - throw new RuntimeException("Invalid value stored for bar"); + throw new InvalidTypeException("Invalid value stored for bar"); } return (long) value; } @@ -182,12 +182,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -213,7 +213,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -221,12 +221,12 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -285,7 +285,7 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu public @NonNull String foo() { @Nullable Object value = get("foo"); if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for foo"); + throw new InvalidTypeException("Invalid value stored for foo"); } return (@NonNull String) value; } @@ -411,12 +411,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -442,7 +442,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -450,12 +450,12 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -610,12 +610,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -641,7 +641,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -649,12 +649,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index a9701ddda33..cb7180637ee 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -140,12 +140,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -171,7 +171,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -179,12 +179,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -330,12 +330,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -361,7 +361,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -369,12 +369,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index a2b03938b3c..69435a3765a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -157,12 +157,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -188,7 +188,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -196,12 +196,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 0f7b5d5bf76..10d456289a1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -175,12 +175,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -206,7 +206,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -214,12 +214,12 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -400,12 +400,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -431,7 +431,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -439,12 +439,12 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } @@ -516,7 +516,7 @@ public static OneofWithRequired1 getInstance() { for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -524,12 +524,12 @@ public static OneofWithRequired1 getInstance() { Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index c9179465ba7..170815ee333 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -149,12 +149,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -180,7 +180,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -188,12 +188,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index a523a00a2cb..f61f3f68224 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -149,12 +149,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -180,7 +180,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -188,12 +188,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 022f3924b4f..806ab0b27a2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -201,12 +201,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -232,7 +232,7 @@ public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -240,12 +240,12 @@ public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index b27b450f527..78a7ccea3bb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -176,12 +176,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -207,7 +207,7 @@ public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -215,12 +215,12 @@ public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 63bb57e74a4..7448e0fd5f8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -74,7 +74,7 @@ public RefInAdditionalpropertiesMap getNewInstance(Map arg, List p for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -82,12 +82,12 @@ public RefInAdditionalpropertiesMap getNewInstance(Map arg, List p Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index 141c7835f5a..034165ecf36 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -148,12 +148,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -187,12 +187,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index e5dbab36beb..8f0f09e0547 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -148,12 +148,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -187,12 +187,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java index 759f7c484a7..75282427268 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java @@ -70,12 +70,12 @@ public RefInItemsList getNewInstance(List arg, List pathToItem, PathT itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index a45fd661e10..4763aeb8b40 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index e6c77b88c6f..ae70c311fd4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -148,12 +148,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -187,12 +187,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index bd241c2ed66..ad5deb97acf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -51,11 +51,9 @@ public static RefInPropertyMap of(Map arg, SchemaConfiguration c public @Nullable Object a() throws UnsetPropertyException { String key = "a"; throwIfKeyNotPresent(key); - // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=CodegenRefInfo{refModule=PropertyNamedRefThatIsNotAReference, refClass=PropertyNamedRefThatIsNotAReference1, refModuleLocation=org.openapijsonschematools.client.components.schemas, refModuleAlias=null}, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - @Nullable Object value = get(key); + @Nullable Object value = get(key); if (!(value instanceof Object)) { - throw new RuntimeException("Invalid value stored for a"); + throw new InvalidTypeException("Invalid value stored for a"); } return (@Nullable Object) value; } @@ -184,12 +182,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -215,7 +213,7 @@ public RefInPropertyMap getNewInstance(Map arg, List pathToItem, P for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -223,12 +221,12 @@ public RefInPropertyMap getNewInstance(Map arg, List pathToItem, P Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 2462904aaea..971ff8dc307 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -182,12 +182,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -213,7 +213,7 @@ public RequiredDefaultValidationMap getNewInstance(Map arg, List p for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -221,12 +221,12 @@ public RequiredDefaultValidationMap getNewInstance(Map arg, List p Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index 74f85a549cd..fc92ce86c79 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -195,12 +195,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -226,7 +226,7 @@ public RequiredValidationMap getNewInstance(Map arg, List pathToIt for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -234,12 +234,12 @@ public RequiredValidationMap getNewInstance(Map arg, List pathToIt Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index d01c9489a8e..c30118b2875 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -182,12 +182,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -213,7 +213,7 @@ public RequiredWithEmptyArrayMap getNewInstance(Map arg, List path for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -221,12 +221,12 @@ public RequiredWithEmptyArrayMap getNewInstance(Map arg, List path Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index 88b0ffdd469..3608517c70d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -181,12 +181,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -212,7 +212,7 @@ public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -220,12 +220,12 @@ public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 1e4a9459a55..effc9e35921 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -100,11 +100,9 @@ public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap of(Map public @NonNull Number alpha() throws UnsetPropertyException { String key = "alpha"; throwIfKeyNotPresent(key); - // mapValueSchema.typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=null, readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - // typeSchema CodegenSchema{, description='null', jsonPathPiece='null', defaultValue='null', title='null', maxLength=null, minLength=null, patternInfo='null', example='null', minimum='null', maximum='null', exclusiveMinimum=null, exclusiveMaximum=null, deprecated=null, types=[number], readOnly=null, writeOnly=null, nullable=null, allowableValues=null, items=null, additionalProperties=null, vendorExtensions=null, hasValidation=false, maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=null, multipleOf=null, xml=null, requiredProperties=null, optionalProperties=null, properties=null, refInfo=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null, allOf=null, anyOf=null, oneOf=null, not=null, externalDocumentation=null, discriminator=null, imports=null, componentModule=false, testCases={}, instanceType=null, jsonPath=null, arrayOutputJsonPathPiece=null} - @Nullable Object value = get(key); + @Nullable Object value = get(key); if (!(value instanceof Number)) { - throw new RuntimeException("Invalid value stored for alpha"); + throw new InvalidTypeException("Invalid value stored for alpha"); } return (@NonNull Number) value; } @@ -150,7 +148,7 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap getNewInstanc for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -158,12 +156,12 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap getNewInstanc Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index 99d2507d260..9ccd156cb6d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 3decfedf129..08a833b31b4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index e91ff11d155..c50f91f7a00 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index b4ac4e2e3cb..a4a819fcd6e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index 6702fd404c6..1e89e599423 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -146,12 +146,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add((@Nullable Object) itemInstance); i += 1; @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -185,12 +185,12 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, (@Nullable Object) propertyInstance); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index 3515813e22b..aaae6e7f054 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -134,7 +134,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); @@ -163,7 +163,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -171,7 +171,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java index ecb9e6f933d..b771a88b7b1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java @@ -45,7 +45,7 @@ public static ListJsonSchema getInstance() { itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index e1f2aa52e65..9098dec1cae 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -44,7 +44,7 @@ public static MapJsonSchema getInstance() { for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -52,7 +52,7 @@ public static MapJsonSchema getInstance() { Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index 4841eb8def7..73046835f2c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -136,7 +136,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); @@ -165,7 +165,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -173,7 +173,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index b68af658be3..36c652e2311 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -294,7 +294,7 @@ protected List castToAllowedTypes(List arg, List pathToItem, Set entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String key = (@NonNull String) entryKey; Object val = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index 58ccf9dfb0d..2d114f921e6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -122,7 +122,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); @@ -151,7 +151,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -159,7 +159,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/NullSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/NullSchemaTest.java index 88bf8cb1536..706d0a9ddad 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/NullSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/NullSchemaTest.java @@ -25,6 +25,7 @@ public class NullSchemaTest { @Test + @SuppressWarnings("nullness") public void testValidateNull() { Void validatedValue = nullJsonSchema.validate(null, configuration); Assert.assertNull(validatedValue); diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs index 8c72bb284e0..33e4e9d02a9 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs @@ -20,7 +20,7 @@ public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{ for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -28,12 +28,12 @@ public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{ Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof {{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true noAnnotations=true }}{{else}}Object{{/with}})) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, ({{#with ../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) propertyInstance); } @@ -68,12 +68,12 @@ public {{#if ../arrayOutputJsonPathPiece}}{{../arrayOutputJsonPathPiece.camelCas itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof {{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true noAnnotations=true }}{{else}}Object{{/with}})) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add(({{#with ../items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) itemInstance); i += 1; @@ -321,12 +321,12 @@ public {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{e itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof {{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true noAnnotations=true }}{{else}}Object{{/with}})) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } items.add(({{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) itemInstance); i += 1; @@ -356,7 +356,7 @@ public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else} for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -364,12 +364,12 @@ public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else} Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof {{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true noAnnotations=true }}{{else}}Object{{/with}})) { - throw new RuntimeException("Invalid instantiated value"); + throw new InvalidTypeException("Invalid instantiated value"); } properties.put(propertyName, ({{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}) propertyInstance); } diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs index aab5970a66f..673a71666ff 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputGetProperty.hbs @@ -4,7 +4,7 @@ return get("{{{@key.original}}}"); {{else}} {{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get("{{{@key.original}}}"); if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true noAnnotations=true }})) { - throw new RuntimeException("Invalid value stored for {{{@key.original}}}"); + throw new InvalidTypeException("Invalid value stored for {{{@key.original}}}"); } return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value; {{/and}} @@ -16,7 +16,7 @@ return get(key); {{else}} {{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get(key); if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true noAnnotations=true }})) { - throw new RuntimeException("Invalid value stored for {{{@key.original}}}"); + throw new InvalidTypeException("Invalid value stored for {{{@key.original}}}"); } return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value; {{/and}} diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs index a2e03f29597..20012498d88 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/_objectOutputProperties.hbs @@ -56,11 +56,19 @@ public {{> src/main/java/packagename/components/schemas/types/schema_output_type {{/or}} throwIfKeyNotPresent(name); {{#and ../../mapValueSchema (eq typeSchema ../../mapValueSchema.typeSchema) }} + {{#and (neq types null) (eq types.size 1) (contains types "boolean") }} + Boolean value = get(name); + if (value == null) { + throw new InvalidTypeException("Value may not be null"); + } + return (boolean) value; + {{else}} return get(name); + {{/and}} {{else}} {{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get(name); if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true noAnnotations=true }})) { - throw new RuntimeException("Invalid value stored for " + name); + throw new InvalidTypeException("Invalid value stored for " + name); } return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value; {{/and}} diff --git a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs index 950069208fa..017c41f3f10 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs @@ -134,7 +134,7 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); @@ -163,7 +163,7 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -171,7 +171,7 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs index 987e116a447..f63f92dfa76 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs @@ -45,7 +45,7 @@ public class ListJsonSchema extends JsonSchema implements ListSchemaValidator schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs index 0004d8ba3ba..3402c700de9 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs @@ -44,7 +44,7 @@ public class MapJsonSchema extends JsonSchema implements MapSchemaValidator entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -52,7 +52,7 @@ public class MapJsonSchema extends JsonSchema implements MapSchemaValidator schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs index 48683125440..dfdb1024a25 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs @@ -136,7 +136,7 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); @@ -165,7 +165,7 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -173,7 +173,7 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index 9034b06ec3e..a5e4d8312ce 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -294,7 +294,7 @@ public abstract class JsonSchema { for (Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String key = (@NonNull String) entryKey; Object val = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs index 32788a0ecd0..ccaa1468e1b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs @@ -122,7 +122,7 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali itemPathToItem.add(i); LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); @@ -151,7 +151,7 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); + throw new InvalidTypeException("Invalid non-string key value"); } @NonNull String propertyName = (@NonNull String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); @@ -159,7 +159,7 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali Object value = entry.getValue(); LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); diff --git a/src/main/resources/java/src/test/java/packagename/schemas/NullSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/NullSchemaTest.hbs index bb7a2e55a10..2acce4245ed 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/NullSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/NullSchemaTest.hbs @@ -25,6 +25,7 @@ public class NullSchemaTest { @Test + @SuppressWarnings("nullness") public void testValidateNull() { Void validatedValue = nullJsonSchema.validate(null, configuration); Assert.assertNull(validatedValue); From 8456fac323cb6c26a868065745d3600fa4345592 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 13:10:46 -0800 Subject: [PATCH 37/52] Fixes ListSchemaTest --- .../openapijsonschematools/client/schemas/ListSchemaTest.java | 4 ++-- .../java/src/test/java/packagename/schemas/ListSchemaTest.hbs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ListSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ListSchemaTest.java index bc9c978e2e0..8b50d60846a 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ListSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ListSchemaTest.java @@ -1,11 +1,11 @@ package org.openapijsonschematools.client.schemas; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaFactory; import org.openapijsonschematools.client.schemas.validation.FrozenList; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; @@ -38,7 +38,7 @@ public void testExceptionThrownForInvalidType() { public void testValidateList() { List inList = new ArrayList<>(); inList.add("today"); - FrozenList validatedValue = listJsonSchema.validate(inList, configuration); + FrozenList<@Nullable Object> validatedValue = listJsonSchema.validate(inList, configuration); ArrayList outList = new ArrayList<>(); outList.add("today"); Assert.assertEquals(validatedValue, outList); diff --git a/src/main/resources/java/src/test/java/packagename/schemas/ListSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/ListSchemaTest.hbs index 7bd571064c7..03a6086b4e4 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/ListSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/ListSchemaTest.hbs @@ -1,11 +1,11 @@ package {{{packageName}}}.schemas; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; import {{{packageName}}}.configurations.SchemaConfiguration; import {{{packageName}}}.schemas.validation.JsonSchema; -import {{{packageName}}}.schemas.validation.JsonSchemaFactory; import {{{packageName}}}.schemas.validation.FrozenList; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.PathToSchemasMap; @@ -38,7 +38,7 @@ public class ListSchemaTest { public void testValidateList() { List inList = new ArrayList<>(); inList.add("today"); - FrozenList validatedValue = listJsonSchema.validate(inList, configuration); + FrozenList<@Nullable Object> validatedValue = listJsonSchema.validate(inList, configuration); ArrayList outList = new ArrayList<>(); outList.add("today"); Assert.assertEquals(validatedValue, outList); From 7fde4b6e121dc11968ab829e9f3374cd68bd05cf Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 13:16:59 -0800 Subject: [PATCH 38/52] Fixes NumberSchemaTest --- .../client/schemas/NumberSchemaTest.java | 18 ++++++++++++++---- .../packagename/schemas/NumberSchemaTest.hbs | 18 ++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/NumberSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/NumberSchemaTest.java index add7500fc2d..48e5ab7d76b 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/NumberSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/NumberSchemaTest.java @@ -5,14 +5,22 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaFactory; import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import java.math.BigDecimal; +import java.util.LinkedHashSet; +import java.util.List; public class NumberSchemaTest { static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); static final NumberJsonSchema numberJsonSchema = NumberJsonSchema.getInstance(); + static final ValidationMetadata validationMetadata = new ValidationMetadata( + List.of("args[0"), + configuration, + new PathToSchemasMap(), + new LinkedHashSet<>() + ); @Test public void testValidateInteger() { @@ -40,8 +48,10 @@ public void testValidateDouble() { @Test public void testExceptionThrownForInvalidType() { - Assert.assertThrows(ValidationException.class, () -> numberJsonSchema.validate( - null, configuration + Assert.assertThrows(ValidationException.class, () -> JsonSchema.validate( + numberJsonSchema, + null, + validationMetadata )); } } diff --git a/src/main/resources/java/src/test/java/packagename/schemas/NumberSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/NumberSchemaTest.hbs index 464fc6ec5b7..e712e6c0572 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/NumberSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/NumberSchemaTest.hbs @@ -5,14 +5,22 @@ import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; import {{{packageName}}}.configurations.SchemaConfiguration; import {{{packageName}}}.schemas.validation.JsonSchema; -import {{{packageName}}}.schemas.validation.JsonSchemaFactory; import {{{packageName}}}.exceptions.ValidationException; +import {{{packageName}}}.schemas.validation.PathToSchemasMap; +import {{{packageName}}}.schemas.validation.ValidationMetadata; -import java.math.BigDecimal; +import java.util.LinkedHashSet; +import java.util.List; public class NumberSchemaTest { static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); static final NumberJsonSchema numberJsonSchema = NumberJsonSchema.getInstance(); + static final ValidationMetadata validationMetadata = new ValidationMetadata( + List.of("args[0"), + configuration, + new PathToSchemasMap(), + new LinkedHashSet<>() + ); @Test public void testValidateInteger() { @@ -40,8 +48,10 @@ public class NumberSchemaTest { @Test public void testExceptionThrownForInvalidType() { - Assert.assertThrows(ValidationException.class, () -> numberJsonSchema.validate( - null, configuration + Assert.assertThrows(ValidationException.class, () -> JsonSchema.validate( + numberJsonSchema, + null, + validationMetadata )); } } From 9ac8f94a6c5d5f95d1a911c7d7fa0ce4d97af8b5 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 13:32:51 -0800 Subject: [PATCH 39/52] Fixes MapSchemaTest --- .../openapijsonschematools/client/schemas/MapSchemaTest.java | 3 ++- .../java/src/test/java/packagename/schemas/MapSchemaTest.hbs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/MapSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/MapSchemaTest.java index e2601fa66e3..dfdea79a4be 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/MapSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/MapSchemaTest.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; @@ -39,7 +40,7 @@ public void testExceptionThrownForInvalidType() { public void testValidateMap() { Map inMap = new LinkedHashMap<>(); inMap.put("today", LocalDate.of(2017, 7, 21)); - FrozenMap validatedValue = mapJsonSchema.validate(inMap, configuration); + FrozenMap<@Nullable Object> validatedValue = mapJsonSchema.validate(inMap, configuration); LinkedHashMap outMap = new LinkedHashMap<>(); outMap.put("today", "2017-07-21"); Assert.assertEquals(validatedValue, outMap); diff --git a/src/main/resources/java/src/test/java/packagename/schemas/MapSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/MapSchemaTest.hbs index 8fdb1b57722..85331314d4e 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/MapSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/MapSchemaTest.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; @@ -39,7 +40,7 @@ public class MapSchemaTest { public void testValidateMap() { Map inMap = new LinkedHashMap<>(); inMap.put("today", LocalDate.of(2017, 7, 21)); - FrozenMap validatedValue = mapJsonSchema.validate(inMap, configuration); + FrozenMap<@Nullable Object> validatedValue = mapJsonSchema.validate(inMap, configuration); LinkedHashMap outMap = new LinkedHashMap<>(); outMap.put("today", "2017-07-21"); Assert.assertEquals(validatedValue, outMap); From 6dfde019f9c855694f410b3ce35a0252db4de1d9 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 13:33:08 -0800 Subject: [PATCH 40/52] Fixes TypeValidatorTest --- .../client/schemas/validation/TypeValidatorTest.java | 10 ++++++++-- .../schemas/validation/TypeValidatorTest.hbs | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/TypeValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/TypeValidatorTest.java index 62f1d7f76a5..70c3049982c 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/TypeValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/TypeValidatorTest.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; @@ -11,6 +12,11 @@ import java.util.LinkedHashSet; public class TypeValidatorTest { + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } @Test public void testValidateSucceeds() { @@ -23,12 +29,12 @@ public void testValidateSucceeds() { new PathToSchemasMap(), new LinkedHashSet<>() ); - PathToSchemasMap pathToSchemasMap = validator.validate( + @Nullable PathToSchemasMap pathToSchemasMap = validator.validate( StringJsonSchema.getInstance(), "hi", validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/TypeValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/TypeValidatorTest.hbs index fb3c13c71c1..99c9bc73d1e 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/TypeValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/TypeValidatorTest.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; @@ -11,6 +12,11 @@ import java.util.ArrayList; import java.util.LinkedHashSet; public class TypeValidatorTest { + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } @Test public void testValidateSucceeds() { @@ -23,12 +29,12 @@ public class TypeValidatorTest { new PathToSchemasMap(), new LinkedHashSet<>() ); - PathToSchemasMap pathToSchemasMap = validator.validate( + @Nullable PathToSchemasMap pathToSchemasMap = validator.validate( StringJsonSchema.getInstance(), "hi", validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test From d5dc906b2da6e8c99e42084f841a8b3e0e2a378f Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 13:37:39 -0800 Subject: [PATCH 41/52] Fixes JsonSchemaTest --- .../client/schemas/validation/JsonSchemaTest.java | 7 ++++--- .../java/packagename/schemas/validation/JsonSchemaTest.hbs | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java index f66926cf23d..d4538bf4f7f 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; @@ -13,7 +14,7 @@ import java.util.Set; class SomeSchema extends JsonSchema { - private static SomeSchema instance; + private static @Nullable SomeSchema instance = null; protected SomeSchema() { super(new JsonSchemaInfo() .type(Set.of(String.class)) @@ -28,11 +29,11 @@ public static SomeSchema getInstance() { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return arg; } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/JsonSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/JsonSchemaTest.hbs index c70d858a0b0..61cb3074d4d 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/JsonSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/JsonSchemaTest.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; @@ -13,7 +14,7 @@ import java.util.List; import java.util.Set; class SomeSchema extends JsonSchema { - private static SomeSchema instance; + private static @Nullable SomeSchema instance = null; protected SomeSchema() { super(new JsonSchemaInfo() .type(Set.of(String.class)) @@ -28,11 +29,11 @@ class SomeSchema extends JsonSchema { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof String) { return arg; } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } From 110018f388577726410468eca56f98ac61330f1c Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 13:47:35 -0800 Subject: [PATCH 42/52] Fixes RequiredValidatorTest --- .../schemas/validation/RequiredValidatorTest.java | 10 ++++++++-- .../schemas/validation/RequiredValidatorTest.hbs | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java index 79daae996ab..37ee2fc6431 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; @@ -14,6 +15,11 @@ import java.util.Set; public class RequiredValidatorTest { + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } @Test public void testCorrectPropertySucceeds() { @@ -37,7 +43,7 @@ public void testCorrectPropertySucceeds() { arg, validationMetadata ); - Assert.assertNull(pathToSchemas); + assertNull(pathToSchemas); } @Test @@ -59,7 +65,7 @@ public void testNotApplicableTypeReturnsNull() { 1, validationMetadata ); - Assert.assertNull(pathToSchemas); + assertNull(pathToSchemas); } @Test diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/RequiredValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/RequiredValidatorTest.hbs index f5a5e025864..156e5a118dd 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/RequiredValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/RequiredValidatorTest.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; @@ -14,6 +15,11 @@ import java.util.List; import java.util.Set; public class RequiredValidatorTest { + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } @Test public void testCorrectPropertySucceeds() { @@ -37,7 +43,7 @@ public class RequiredValidatorTest { arg, validationMetadata ); - Assert.assertNull(pathToSchemas); + assertNull(pathToSchemas); } @Test @@ -59,7 +65,7 @@ public class RequiredValidatorTest { 1, validationMetadata ); - Assert.assertNull(pathToSchemas); + assertNull(pathToSchemas); } @Test From c27222521c9e71e969505905cddf5802af4497d0 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 13:52:17 -0800 Subject: [PATCH 43/52] Fixes AnyTypeSchemaTest --- .../client/schemas/AnyTypeSchemaTest.java | 10 ++++++++-- .../java/packagename/schemas/AnyTypeSchemaTest.hbs | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/AnyTypeSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/AnyTypeSchemaTest.java index 36db994c30d..381e9fb422f 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/AnyTypeSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/AnyTypeSchemaTest.java @@ -1,10 +1,10 @@ package org.openapijsonschematools.client.schemas; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaFactory; import org.openapijsonschematools.client.schemas.validation.FrozenList; import org.openapijsonschematools.client.schemas.validation.FrozenMap; @@ -19,10 +19,16 @@ public class AnyTypeSchemaTest { static final AnyTypeJsonSchema schema = AnyTypeJsonSchema.getInstance(); static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } + @Test public void testValidateNull() { Void validatedValue = schema.validate((Void) null, configuration); - Assert.assertNull(validatedValue); + assertNull(validatedValue); } @Test diff --git a/src/main/resources/java/src/test/java/packagename/schemas/AnyTypeSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/AnyTypeSchemaTest.hbs index 25467823fb3..ac605239396 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/AnyTypeSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/AnyTypeSchemaTest.hbs @@ -1,10 +1,10 @@ package {{{packageName}}}.schemas; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; import {{{packageName}}}.configurations.SchemaConfiguration; -import {{{packageName}}}.schemas.validation.JsonSchemaFactory; import {{{packageName}}}.schemas.validation.FrozenList; import {{{packageName}}}.schemas.validation.FrozenMap; @@ -19,10 +19,16 @@ public class AnyTypeSchemaTest { static final AnyTypeJsonSchema schema = AnyTypeJsonSchema.getInstance(); static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } + @Test public void testValidateNull() { Void validatedValue = schema.validate((Void) null, configuration); - Assert.assertNull(validatedValue); + assertNull(validatedValue); } @Test From 63411aa81cfd61fb48ec317a41a1e32b094daafc Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 14:01:35 -0800 Subject: [PATCH 44/52] FIxes ItemsValidatorTest --- .../schemas/validation/ItemsValidatorTest.java | 11 ++++++++++- .../schemas/validation/ItemsValidatorTest.hbs | 12 +++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java index fba34f90055..6338a1159d5 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; @@ -14,6 +15,11 @@ import java.util.List; public class ItemsValidatorTest { + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } @Test public void testCorrectItemsSucceeds() { @@ -34,6 +40,9 @@ public void testCorrectItemsSucceeds() { arg, validationMetadata ); + if (pathToSchemas == null) { + throw new RuntimeException("Invalid null value in pathToSchemas for this test case"); + } List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add(0); @@ -61,7 +70,7 @@ public void testNotApplicableTypeReturnsNull() { 1, validationMetadata ); - Assert.assertNull(pathToSchemas); + assertNull(pathToSchemas); } @Test diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/ItemsValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/ItemsValidatorTest.hbs index db5fbd04973..082711a3fbc 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/ItemsValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/ItemsValidatorTest.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; @@ -14,6 +15,11 @@ import java.util.LinkedHashSet; import java.util.List; public class ItemsValidatorTest { + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } @Test public void testCorrectItemsSucceeds() { @@ -34,6 +40,9 @@ public class ItemsValidatorTest { arg, validationMetadata ); + if (pathToSchemas == null) { + throw new RuntimeException("Invalid null value in pathToSchemas for this test case"); + } List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add(0); @@ -61,7 +70,7 @@ public class ItemsValidatorTest { 1, validationMetadata ); - Assert.assertNull(pathToSchemas); + assertNull(pathToSchemas); } @Test @@ -85,3 +94,4 @@ public class ItemsValidatorTest { )); } } + From c8859ec347e2f9f16326159ff2bcdb797e8e4c5d Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 14:18:54 -0800 Subject: [PATCH 45/52] Fixes FormatValidatorTest --- .../validation/FormatValidatorTest.java | 35 +++++++++++-------- .../validation/ItemsValidatorTest.java | 1 + .../validation/FormatValidatorTest.hbs | 35 +++++++++++-------- 3 files changed, 43 insertions(+), 28 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/FormatValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/FormatValidatorTest.java index 8451ff94b0f..10f07ffc2f9 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/FormatValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/FormatValidatorTest.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; @@ -21,6 +22,12 @@ public class FormatValidatorTest { new LinkedHashSet<>() ); + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } + @Test public void testIntFormatSucceedsWithFloat() { final FormatValidator validator = new FormatValidator("int"); @@ -29,7 +36,7 @@ public void testIntFormatSucceedsWithFloat() { 1.0f, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -50,7 +57,7 @@ public void testIntFormatSucceedsWithInt() { 1, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -71,7 +78,7 @@ public void testInt32InclusiveMinSucceeds() { -2147483648, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -82,7 +89,7 @@ public void testInt32InclusiveMaxSucceeds() { 2147483647, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -114,7 +121,7 @@ public void testInt64InclusiveMinSucceeds() { -9223372036854775808L, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -125,7 +132,7 @@ public void testInt64InclusiveMaxSucceeds() { 9223372036854775807L, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -157,7 +164,7 @@ public void testFloatInclusiveMinSucceeds() { -3.4028234663852886e+38f, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -168,7 +175,7 @@ public void testFloatInclusiveMaxSucceeds() { 3.4028234663852886e+38f, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -199,7 +206,7 @@ public void testDoubleInclusiveMinSucceeds() { -1.7976931348623157E+308d, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -210,7 +217,7 @@ public void testDoubleInclusiveMaxSucceeds() { 1.7976931348623157E+308d, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -241,7 +248,7 @@ public void testValidFloatNumberStringSucceeds() { "3.14", validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -252,7 +259,7 @@ public void testValidIntNumberStringSucceeds() { "1", validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -273,7 +280,7 @@ public void testValidDateStringSucceeds() { "2017-01-20", validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -294,6 +301,6 @@ public void testValidDateTimeStringSucceeds() { "2017-07-21T17:32:28Z", validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } } diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java index 6338a1159d5..ffb72ed6c64 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java @@ -94,3 +94,4 @@ public void testIncorrectItemFails() { )); } } + diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/FormatValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/FormatValidatorTest.hbs index ee059035bdd..1a1c3c217d2 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/FormatValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/FormatValidatorTest.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; @@ -21,6 +22,12 @@ public class FormatValidatorTest { new LinkedHashSet<>() ); + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } + @Test public void testIntFormatSucceedsWithFloat() { final FormatValidator validator = new FormatValidator("int"); @@ -29,7 +36,7 @@ public class FormatValidatorTest { 1.0f, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -50,7 +57,7 @@ public class FormatValidatorTest { 1, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -71,7 +78,7 @@ public class FormatValidatorTest { -2147483648, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -82,7 +89,7 @@ public class FormatValidatorTest { 2147483647, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -114,7 +121,7 @@ public class FormatValidatorTest { -9223372036854775808L, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -125,7 +132,7 @@ public class FormatValidatorTest { 9223372036854775807L, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -157,7 +164,7 @@ public class FormatValidatorTest { -3.4028234663852886e+38f, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -168,7 +175,7 @@ public class FormatValidatorTest { 3.4028234663852886e+38f, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -199,7 +206,7 @@ public class FormatValidatorTest { -1.7976931348623157E+308d, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -210,7 +217,7 @@ public class FormatValidatorTest { 1.7976931348623157E+308d, validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -241,7 +248,7 @@ public class FormatValidatorTest { "3.14", validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -252,7 +259,7 @@ public class FormatValidatorTest { "1", validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -273,7 +280,7 @@ public class FormatValidatorTest { "2017-01-20", validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } @Test @@ -294,6 +301,6 @@ public class FormatValidatorTest { "2017-07-21T17:32:28Z", validationMetadata ); - Assert.assertNull(pathToSchemasMap); + assertNull(pathToSchemasMap); } } From 288b97af2f3bab74e611e3ab9aa8abac79e6ae80 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 14:46:20 -0800 Subject: [PATCH 46/52] Fixes AdditionalPropertiesValidatorTest --- .../AdditionalPropertiesValidatorTest.java | 27 ++++++++++++------- .../validation/PropertiesValidatorTest.java | 12 ++++++++- .../AdditionalPropertiesValidatorTest.hbs | 27 ++++++++++++------- .../validation/PropertiesValidatorTest.hbs | 12 +++++++-- 4 files changed, 57 insertions(+), 21 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java index 01f2d0fcd18..c24c93ce54c 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; @@ -17,15 +18,14 @@ import java.util.Set; public class AdditionalPropertiesValidatorTest { - public static class ObjectWithPropsSchema extends JsonSchema { - private static ObjectWithPropsSchema instance; + private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() - .type(Set.of(FrozenMap.class)) - .properties(Map.ofEntries( - new PropertyEntry("someString", StringJsonSchema.class) - )) + .type(Set.of(FrozenMap.class)) + .properties(Map.ofEntries( + new PropertyEntry("someString", StringJsonSchema.class) + )) ); } @@ -38,15 +38,21 @@ public static ObjectWithPropsSchema getInstance() { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { @SuppressWarnings("unchecked") FrozenMap castArg = (FrozenMap) arg; return castArg; } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } + @Test public void testCorrectPropertySucceeds() { List pathToItem = new ArrayList<>(); @@ -67,6 +73,9 @@ public void testCorrectPropertySucceeds() { arg, validationMetadata ); + if (pathToSchemas == null) { + throw new RuntimeException("Invalid null value for pathToSchemas for this test case"); + } List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someAddProp"); @@ -94,7 +103,7 @@ public void testNotApplicableTypeReturnsNull() { 1, validationMetadata ); - Assert.assertNull(pathToSchemas); + assertNull(pathToSchemas); } @Test diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java index 137a5445aaf..4d5d445aaa2 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; @@ -15,6 +16,12 @@ import java.util.Map; public class PropertiesValidatorTest { + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } + @Test public void testCorrectPropertySucceeds() { Map> properties = new LinkedHashMap<>(); @@ -37,6 +44,9 @@ public void testCorrectPropertySucceeds() { arg, validationMetadata ); + if (pathToSchemas == null) { + throw new RuntimeException("Invalid null value for pathToSchemas for this test case"); + } List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someString"); @@ -66,7 +76,7 @@ public void testNotApplicableTypeReturnsNull() { 1, validationMetadata ); - Assert.assertNull(pathToSchemas); + assertNull(pathToSchemas); } @Test diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/AdditionalPropertiesValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/AdditionalPropertiesValidatorTest.hbs index 31f81bfca82..2c787064d5a 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/AdditionalPropertiesValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/AdditionalPropertiesValidatorTest.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; @@ -17,15 +18,14 @@ import java.util.Map; import java.util.Set; public class AdditionalPropertiesValidatorTest { - public static class ObjectWithPropsSchema extends JsonSchema { - private static ObjectWithPropsSchema instance; + private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() - .type(Set.of(FrozenMap.class)) - .properties(Map.ofEntries( - new PropertyEntry("someString", StringJsonSchema.class) - )) + .type(Set.of(FrozenMap.class)) + .properties(Map.ofEntries( + new PropertyEntry("someString", StringJsonSchema.class) + )) ); } @@ -38,15 +38,21 @@ public class AdditionalPropertiesValidatorTest { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { @SuppressWarnings("unchecked") FrozenMap castArg = (FrozenMap) arg; return castArg; } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } + @Test public void testCorrectPropertySucceeds() { List pathToItem = new ArrayList<>(); @@ -67,6 +73,9 @@ public class AdditionalPropertiesValidatorTest { arg, validationMetadata ); + if (pathToSchemas == null) { + throw new RuntimeException("Invalid null value for pathToSchemas for this test case"); + } List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someAddProp"); @@ -94,7 +103,7 @@ public class AdditionalPropertiesValidatorTest { 1, validationMetadata ); - Assert.assertNull(pathToSchemas); + assertNull(pathToSchemas); } @Test diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs index dfd783a9e62..9341c06d8a8 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; @@ -15,6 +16,12 @@ import java.util.List; import java.util.Map; public class PropertiesValidatorTest { + @SuppressWarnings("nullness") + private Void assertNull(@Nullable Object object) { + Assert.assertNull(object); + return null; + } + @Test public void testCorrectPropertySucceeds() { Map> properties = new LinkedHashMap<>(); @@ -42,7 +49,7 @@ public class PropertiesValidatorTest { expectedPathToItem.add("someString"); LinkedHashMap expectedClasses = new LinkedHashMap<>(); expectedClasses.put(JsonSchemaFactory.getInstance(StringJsonSchema.class), null); - PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); + @Nullable PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); expectedPathToSchemas.put(expectedPathToItem, expectedClasses); Assert.assertEquals(pathToSchemas, expectedPathToSchemas); } @@ -66,7 +73,7 @@ public class PropertiesValidatorTest { 1, validationMetadata ); - Assert.assertNull(pathToSchemas); + assertNull(pathToSchemas); } @Test @@ -93,3 +100,4 @@ public class PropertiesValidatorTest { )); } } + From 4aa597f67899c34a3d776d8be59f30fdb44ef597 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 15:05:34 -0800 Subject: [PATCH 47/52] Fixes ArrayTypeSchemaTest --- .../client/schemas/ArrayTypeSchemaTest.java | 53 ++++++++++++------- .../validation/PropertiesValidatorTest.java | 6 +-- .../schemas/ArrayTypeSchemaTest.hbs | 53 ++++++++++++------- 3 files changed, 72 insertions(+), 40 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java index 749c156a71d..0623ceeb056 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java @@ -1,5 +1,7 @@ package org.openapijsonschematools.client.schemas; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; @@ -15,6 +17,7 @@ import java.util.ArrayList; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Objects; @@ -29,7 +32,7 @@ public class ArrayTypeSchemaTest { new LinkedHashSet<>() ); - public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator> { + public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator> { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -38,22 +41,29 @@ public ArrayWithItemsSchema() { } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@NonNull String> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@NonNull String> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - String castItem = (String) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(castItem instanceof String)) { + throw new InvalidTypeException("Instantiated type of item is invalid"); + } + items.add((@NonNull String) castItem); i += 1; } return new FrozenList<>(items); } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList<@NonNull String> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -64,16 +74,16 @@ public FrozenList validate(List arg, SchemaConfiguration configu } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } - public static class ArrayWithOutputClsSchemaList extends FrozenList { - protected ArrayWithOutputClsSchemaList(FrozenList m) { + public static class ArrayWithOutputClsSchemaList extends FrozenList<@NonNull String> { + protected ArrayWithOutputClsSchemaList(FrozenList<@NonNull String> m) { super(m); } @@ -93,17 +103,24 @@ public ArrayWithOutputClsSchema() { @Override public ArrayWithOutputClsSchemaList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - ArrayList items = new ArrayList<>(); + List<@NonNull String> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - String castItem = (String) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(castItem instanceof String)) { + throw new InvalidTypeException("Instantiated type of item is invalid"); + } + items.add((@NonNull String) castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@NonNull String> newInstanceItems = new FrozenList<>(items); return new ArrayWithOutputClsSchemaList(newInstanceItems); } @@ -119,11 +136,11 @@ public ArrayWithOutputClsSchemaList validate(List arg, SchemaConfigurati } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java index 4d5d445aaa2..079ae1c20e4 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java @@ -44,15 +44,12 @@ public void testCorrectPropertySucceeds() { arg, validationMetadata ); - if (pathToSchemas == null) { - throw new RuntimeException("Invalid null value for pathToSchemas for this test case"); - } List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someString"); LinkedHashMap expectedClasses = new LinkedHashMap<>(); expectedClasses.put(JsonSchemaFactory.getInstance(StringJsonSchema.class), null); - PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); + @Nullable PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); expectedPathToSchemas.put(expectedPathToItem, expectedClasses); Assert.assertEquals(pathToSchemas, expectedPathToSchemas); } @@ -103,3 +100,4 @@ public void testIncorrectPropertyValueFails() { )); } } + diff --git a/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs index e2f2058b688..9fe2805c771 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs @@ -1,5 +1,7 @@ package {{{packageName}}}.schemas; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; @@ -15,6 +17,7 @@ import {{{packageName}}}.schemas.validation.ValidationMetadata; import java.util.ArrayList; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Objects; @@ -29,7 +32,7 @@ public class ArrayTypeSchemaTest { new LinkedHashSet<>() ); - public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator> { + public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator> { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -38,22 +41,29 @@ public class ArrayTypeSchemaTest { } @Override - public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List items = new ArrayList<>(); + public FrozenList<@NonNull String> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List<@NonNull String> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - String castItem = (String) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(castItem instanceof String)) { + throw new InvalidTypeException("Instantiated type of item is invalid"); + } + items.add((@NonNull String) castItem); i += 1; } return new FrozenList<>(items); } @Override - public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList<@NonNull String> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -64,16 +74,16 @@ public class ArrayTypeSchemaTest { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } - public static class ArrayWithOutputClsSchemaList extends FrozenList { - protected ArrayWithOutputClsSchemaList(FrozenList m) { + public static class ArrayWithOutputClsSchemaList extends FrozenList<@NonNull String> { + protected ArrayWithOutputClsSchemaList(FrozenList<@NonNull String> m) { super(m); } @@ -93,17 +103,24 @@ public class ArrayTypeSchemaTest { @Override public ArrayWithOutputClsSchemaList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - ArrayList items = new ArrayList<>(); + List<@NonNull String> items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - JsonSchema itemSchema = pathToSchemas.get(itemPathToItem).entrySet().iterator().next().getKey(); - String castItem = (String) itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); - items.add(castItem); + LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); + if (!(castItem instanceof String)) { + throw new InvalidTypeException("Instantiated type of item is invalid"); + } + items.add((@NonNull String) castItem); i += 1; } - FrozenList newInstanceItems = new FrozenList<>(items); + FrozenList<@NonNull String> newInstanceItems = new FrozenList<>(items); return new ArrayWithOutputClsSchemaList(newInstanceItems); } @@ -119,11 +136,11 @@ public class ArrayTypeSchemaTest { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof List) { return getNewInstance((List) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } From 7b7186819813ace66ed47fbff6d5f17d93d059c0 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 15:11:50 -0800 Subject: [PATCH 48/52] Fixes PropertiesValidatorTest --- .../client/schemas/validation/PropertiesValidatorTest.java | 5 ++++- .../schemas/validation/PropertiesValidatorTest.hbs | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java index 079ae1c20e4..726458a6934 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java @@ -44,12 +44,15 @@ public void testCorrectPropertySucceeds() { arg, validationMetadata ); + if (pathToSchemas == null) { + throw new RuntimeException("Invalid null value for pathToSchemas for this test case"); + } List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someString"); LinkedHashMap expectedClasses = new LinkedHashMap<>(); expectedClasses.put(JsonSchemaFactory.getInstance(StringJsonSchema.class), null); - @Nullable PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); + PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); expectedPathToSchemas.put(expectedPathToItem, expectedClasses); Assert.assertEquals(pathToSchemas, expectedPathToSchemas); } diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs index 9341c06d8a8..5ae3dfc6c67 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs @@ -44,12 +44,15 @@ public class PropertiesValidatorTest { arg, validationMetadata ); + if (pathToSchemas == null) { + throw new RuntimeException("Invalid null value for pathToSchemas for this test case"); + } List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someString"); LinkedHashMap expectedClasses = new LinkedHashMap<>(); expectedClasses.put(JsonSchemaFactory.getInstance(StringJsonSchema.class), null); - @Nullable PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); + PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); expectedPathToSchemas.put(expectedPathToItem, expectedClasses); Assert.assertEquals(pathToSchemas, expectedPathToSchemas); } @@ -100,4 +103,3 @@ public class PropertiesValidatorTest { )); } } - From 9834bfed5c29b8c4e6290389061d2f186426e9c6 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 15:32:07 -0800 Subject: [PATCH 49/52] Removes NonNull --- .../AdditionalpropertiesCanExistByItself.md | 2 +- ...nalpropertiesShouldNotLookInApplicators.md | 2 +- .../java/docs/components/schemas/Allof.md | 2 +- .../components/schemas/AllofWithBaseSchema.md | 2 +- .../components/schemas/AnyofComplexTypes.md | 2 +- .../components/schemas/EnumsInProperties.md | 4 +- .../schemas/InvalidStringValueForDefault.md | 2 +- .../docs/components/schemas/NestedItems.md | 8 +-- .../schemas/NotMoreComplexSchema.md | 2 +- .../schemas/ObjectPropertiesValidation.md | 2 +- .../components/schemas/OneofComplexTypes.md | 2 +- ...DoesNotDoAnythingIfThePropertyIsMissing.md | 2 +- samples/client/3_0_3_unit_test/java/pom.xml | 2 +- ...rtiesAllowsASchemaWhichShouldValidate.java | 2 +- ...ditionalpropertiesAreAllowedByDefault.java | 2 +- .../AdditionalpropertiesCanExistByItself.java | 12 ++--- ...lpropertiesShouldNotLookInApplicators.java | 14 +++--- .../client/components/schemas/Allof.java | 10 ++-- .../schemas/AllofCombinedWithAnyofOneof.java | 8 +-- .../components/schemas/AllofSimpleTypes.java | 6 +-- .../schemas/AllofWithBaseSchema.java | 10 ++-- .../schemas/AllofWithOneEmptySchema.java | 2 +- .../schemas/AllofWithTheFirstEmptySchema.java | 2 +- .../schemas/AllofWithTheLastEmptySchema.java | 2 +- .../schemas/AllofWithTwoEmptySchemas.java | 2 +- .../client/components/schemas/Anyof.java | 4 +- .../components/schemas/AnyofComplexTypes.java | 10 ++-- .../schemas/AnyofWithBaseSchema.java | 4 +- .../schemas/AnyofWithOneEmptySchema.java | 2 +- .../client/components/schemas/ByInt.java | 2 +- .../client/components/schemas/ByNumber.java | 2 +- .../components/schemas/BySmallNumber.java | 2 +- .../components/schemas/DateTimeFormat.java | 2 +- .../components/schemas/EmailFormat.java | 2 +- .../components/schemas/EnumsInProperties.java | 10 ++-- .../components/schemas/ForbiddenProperty.java | 2 +- .../components/schemas/HostnameFormat.java | 2 +- .../schemas/InvalidStringValueForDefault.java | 6 +-- .../client/components/schemas/Ipv4Format.java | 2 +- .../client/components/schemas/Ipv6Format.java | 2 +- .../components/schemas/JsonPointerFormat.java | 2 +- .../components/schemas/MaximumValidation.java | 2 +- .../MaximumValidationWithUnsignedInteger.java | 2 +- .../schemas/MaxitemsValidation.java | 2 +- .../schemas/MaxlengthValidation.java | 2 +- .../Maxproperties0MeansTheObjectIsEmpty.java | 2 +- .../schemas/MaxpropertiesValidation.java | 2 +- .../components/schemas/MinimumValidation.java | 2 +- .../MinimumValidationWithSignedInteger.java | 2 +- .../schemas/MinitemsValidation.java | 2 +- .../schemas/MinlengthValidation.java | 2 +- .../schemas/MinpropertiesValidation.java | 2 +- ...NestedAllofToCheckValidationSemantics.java | 4 +- ...NestedAnyofToCheckValidationSemantics.java | 4 +- .../components/schemas/NestedItems.java | 40 +++++++-------- ...NestedOneofToCheckValidationSemantics.java | 4 +- .../client/components/schemas/Not.java | 2 +- .../schemas/NotMoreComplexSchema.java | 8 +-- .../schemas/ObjectPropertiesValidation.java | 6 +-- .../client/components/schemas/Oneof.java | 4 +- .../components/schemas/OneofComplexTypes.java | 10 ++-- .../schemas/OneofWithBaseSchema.java | 4 +- .../schemas/OneofWithEmptySchema.java | 2 +- .../components/schemas/OneofWithRequired.java | 6 +-- .../schemas/PatternIsNotAnchored.java | 2 +- .../components/schemas/PatternValidation.java | 2 +- .../PropertiesWithEscapedCharacters.java | 2 +- .../PropertyNamedRefThatIsNotAReference.java | 2 +- .../schemas/RefInAdditionalproperties.java | 2 +- .../client/components/schemas/RefInAllof.java | 2 +- .../client/components/schemas/RefInAnyof.java | 2 +- .../client/components/schemas/RefInNot.java | 2 +- .../client/components/schemas/RefInOneof.java | 2 +- .../components/schemas/RefInProperty.java | 2 +- .../schemas/RequiredDefaultValidation.java | 2 +- .../schemas/RequiredValidation.java | 2 +- .../schemas/RequiredWithEmptyArray.java | 2 +- .../RequiredWithEscapedCharacters.java | 2 +- ...esNotDoAnythingIfThePropertyIsMissing.java | 6 +-- .../schemas/UniqueitemsFalseValidation.java | 2 +- .../schemas/UniqueitemsValidation.java | 2 +- .../client/components/schemas/UriFormat.java | 2 +- .../schemas/UriReferenceFormat.java | 2 +- .../components/schemas/UriTemplateFormat.java | 2 +- .../client/schemas/AnyTypeJsonSchema.java | 3 +- .../client/schemas/BooleanJsonSchema.java | 1 - .../client/schemas/DateJsonSchema.java | 7 ++- .../client/schemas/DateTimeJsonSchema.java | 1 - .../client/schemas/DecimalJsonSchema.java | 1 - .../client/schemas/DoubleJsonSchema.java | 1 - .../client/schemas/FloatJsonSchema.java | 1 - .../client/schemas/Int32JsonSchema.java | 1 - .../client/schemas/Int64JsonSchema.java | 1 - .../client/schemas/IntJsonSchema.java | 1 - .../client/schemas/MapJsonSchema.java | 3 +- .../client/schemas/NotAnyTypeJsonSchema.java | 3 +- .../client/schemas/NullJsonSchema.java | 1 - .../client/schemas/NumberJsonSchema.java | 1 - .../client/schemas/StringJsonSchema.java | 1 - .../client/schemas/UuidJsonSchema.java | 1 - .../client/schemas/validation/FrozenMap.java | 3 +- .../client/schemas/validation/JsonSchema.java | 5 +- .../schemas/validation/JsonSchemaFactory.java | 5 +- .../schemas/validation/JsonSchemaInfo.java | 49 +++++++++---------- .../validation/UnsetAnyTypeJsonSchema.java | 3 +- .../validation/ValidationMetadata.java | 3 +- .../client/schemas/ArrayTypeSchemaTest.java | 21 ++++---- .../validation/PropertiesValidatorTest.java | 1 - src/main/resources/java/pom.hbs | 2 +- .../SchemaClass/_validate_implementor.hbs | 4 +- .../types/_schema_output_type_base.hbs | 32 ++++++------ .../packagename/schemas/AnyTypeJsonSchema.hbs | 3 +- .../packagename/schemas/BooleanJsonSchema.hbs | 1 - .../packagename/schemas/DateJsonSchema.hbs | 7 ++- .../schemas/DateTimeJsonSchema.hbs | 1 - .../packagename/schemas/DecimalJsonSchema.hbs | 1 - .../packagename/schemas/DoubleJsonSchema.hbs | 1 - .../packagename/schemas/FloatJsonSchema.hbs | 1 - .../packagename/schemas/Int32JsonSchema.hbs | 1 - .../packagename/schemas/Int64JsonSchema.hbs | 1 - .../packagename/schemas/IntJsonSchema.hbs | 1 - .../packagename/schemas/MapJsonSchema.hbs | 3 +- .../schemas/NotAnyTypeJsonSchema.hbs | 3 +- .../packagename/schemas/NullJsonSchema.hbs | 1 - .../packagename/schemas/NumberJsonSchema.hbs | 1 - .../packagename/schemas/StringJsonSchema.hbs | 1 - .../packagename/schemas/UuidJsonSchema.hbs | 1 - .../schemas/validation/FrozenMap.hbs | 3 +- .../schemas/validation/JsonSchema.hbs | 5 +- .../schemas/validation/JsonSchemaFactory.hbs | 5 +- .../schemas/validation/JsonSchemaInfo.hbs | 49 +++++++++---------- .../validation/UnsetAnyTypeJsonSchema.hbs | 3 +- .../schemas/validation/ValidationMetadata.hbs | 3 +- .../schemas/ArrayTypeSchemaTest.hbs | 21 ++++---- 134 files changed, 274 insertions(+), 321 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md index 9907a7c0886..9f44bcd9bbd 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md @@ -71,7 +71,7 @@ A class that builds the Map input type ## AdditionalpropertiesCanExistByItselfMap public static class AdditionalpropertiesCanExistByItselfMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md index d88c316026c..528fe0a028b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md @@ -59,7 +59,7 @@ A class that builds the Map input type ## AdditionalpropertiesShouldNotLookInApplicatorsMap public static class AdditionalpropertiesShouldNotLookInApplicatorsMap
-extends FrozenMap +extends FrozenMap A class to store validated Map payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md index 57906d86296..7791aefeacf 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md @@ -93,7 +93,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | -| @NonNull String | foo()
| +| String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md index 5d7350e9558..295dcfb4ef7 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md @@ -193,7 +193,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | -| @NonNull String | foo()
| +| String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md index dcee1548346..21921a7eb2c 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md @@ -93,7 +93,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | -| @NonNull String | foo()
| +| String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md index e91156b0575..88d4b1d505b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md @@ -91,8 +91,8 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [EnumsInPropertiesMap](#enumsinpropertiesmap) | of([Map](#enumsinpropertiesmapinput) arg, SchemaConfiguration configuration) | -| @NonNull String | bar()
must be one of ["bar"] | -| @NonNull String | foo()
[optional] must be one of ["foo"] | +| String | bar()
must be one of ["bar"] | +| String | foo()
[optional] must be one of ["foo"] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Bar diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md index e6db3e1f47a..bbb7e03d06b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md @@ -63,7 +63,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [InvalidStringValueForDefaultMap](#invalidstringvaluefordefaultmap) | of([Map](#invalidstringvaluefordefaultmapinput) arg, SchemaConfiguration configuration) | -| @NonNull String | bar()
[optional] if omitted the server will use the default value of bad | +| String | bar()
[optional] if omitted the server will use the default value of bad | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Bar diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md index 31d3bdef2a8..3b7061133ae 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md @@ -87,7 +87,7 @@ List>> | | ## NestedItemsList public class NestedItemsList
-extends `FrozenList<@NonNull ItemsList2>` +extends `FrozenList` A class to store validated List payloads @@ -155,7 +155,7 @@ List> | | ## ItemsList2 public class ItemsList2
-extends `FrozenList<@NonNull ItemsList1>` +extends `FrozenList` A class to store validated List payloads @@ -221,7 +221,7 @@ List | | ## ItemsList1 public class ItemsList1
-extends `FrozenList<@NonNull ItemsList>` +extends `FrozenList` A class to store validated List payloads @@ -285,7 +285,7 @@ Number | | ## ItemsList public class ItemsList
-extends `FrozenList<@NonNull Number>` +extends `FrozenList` A class to store validated List payloads diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md index 95a26af3823..8d7270325bb 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md @@ -109,7 +109,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [NotMap](#notmap) | of([Map](#notmapinput) arg, SchemaConfiguration configuration) | -| @NonNull String | foo()
[optional] | +| String | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md index 8b627813573..0dfbac98c39 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md @@ -66,7 +66,7 @@ A class to store validated Map payloads | ----------------- | ---------------------- | | static [ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) | of([Map](#objectpropertiesvalidationmapinput) arg, SchemaConfiguration configuration) | | long | foo()
[optional] | -| @NonNull String | bar()
[optional] | +| String | bar()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Bar diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md index fe20f737807..39f86c18df2 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md @@ -93,7 +93,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | -| @NonNull String | foo()
| +| String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Foo diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md index 58eb7267bf8..973eaace1dc 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md @@ -84,7 +84,7 @@ A class to store validated Map payloads | Modifier and Type | Method and Description | | ----------------- | ---------------------- | | static [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) | of([Map](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmapinput) arg, SchemaConfiguration configuration) | -| @NonNull Number | alpha()
[optional] if omitted the server will use the default value of 5.0 | +| Number | alpha()
[optional] if omitted the server will use the default value of 5.0 | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Alpha diff --git a/samples/client/3_0_3_unit_test/java/pom.xml b/samples/client/3_0_3_unit_test/java/pom.xml index de3b2c6c85e..8d59416158a 100644 --- a/samples/client/3_0_3_unit_test/java/pom.xml +++ b/samples/client/3_0_3_unit_test/java/pom.xml @@ -234,7 +234,7 @@ ${swagger-annotations-version} - + org.checkerframework checker-qual diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 75f192b8815..490701281d7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -112,7 +112,7 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap getNewInstance(Ma if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index fefbe6aa089..345dbaaf58e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -226,7 +226,7 @@ public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index e40f368eb4c..0cd7de194f5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -30,8 +30,8 @@ public class AdditionalpropertiesCanExistByItself { public static class AdditionalProperties extends BooleanJsonSchema {} - public static class AdditionalpropertiesCanExistByItselfMap extends FrozenMap<@NonNull Boolean> { - protected AdditionalpropertiesCanExistByItselfMap(FrozenMap<@NonNull Boolean> m) { + public static class AdditionalpropertiesCanExistByItselfMap extends FrozenMap { + protected AdditionalpropertiesCanExistByItselfMap(FrozenMap m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -78,13 +78,13 @@ public static AdditionalpropertiesCanExistByItself1 getInstance() { } public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -97,9 +97,9 @@ public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, Lis if (!(propertyInstance instanceof Boolean)) { throw new InvalidTypeException("Invalid instantiated value"); } - properties.put(propertyName, (@NonNull Boolean) propertyInstance); + properties.put(propertyName, (Boolean) propertyInstance); } - FrozenMap<@NonNull Boolean> castProperties = new FrozenMap<>(properties); + FrozenMap castProperties = new FrozenMap<>(properties); return new AdditionalpropertiesCanExistByItselfMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index aea5474eeaf..2ab3599b0e1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -213,7 +213,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -265,8 +265,8 @@ public Schema0Map validate(Map arg, SchemaConfiguration configur } } - public static class AdditionalpropertiesShouldNotLookInApplicatorsMap extends FrozenMap<@NonNull Boolean> { - protected AdditionalpropertiesShouldNotLookInApplicatorsMap(FrozenMap<@NonNull Boolean> m) { + public static class AdditionalpropertiesShouldNotLookInApplicatorsMap extends FrozenMap { + protected AdditionalpropertiesShouldNotLookInApplicatorsMap(FrozenMap m) { super(m); } public static final Set requiredKeys = Set.of(); @@ -430,13 +430,13 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid @Override public AdditionalpropertiesShouldNotLookInApplicatorsMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { @Nullable Object entryKey = entry.getKey(); if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -449,9 +449,9 @@ public AdditionalpropertiesShouldNotLookInApplicatorsMap getNewInstance(Map castProperties = new FrozenMap<>(properties); + FrozenMap castProperties = new FrozenMap<>(properties); return new AdditionalpropertiesShouldNotLookInApplicatorsMap(castProperties); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 633b379b5bc..41d2b5ebde2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -215,7 +215,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -282,12 +282,12 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu return Schema1.getInstance().validate(arg, configuration); } - public @NonNull String foo() { + public String foo() { @Nullable Object value = get("foo"); if (!(value instanceof String)) { throw new InvalidTypeException("Invalid value stored for foo"); } - return (@NonNull String) value; + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -444,7 +444,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -643,7 +643,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index 985f0ce004a..f1a221843ae 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -174,7 +174,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -364,7 +364,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -554,7 +554,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -758,7 +758,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index ed062d16197..6aefa9f4617 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -173,7 +173,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -363,7 +363,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -562,7 +562,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index ceeaebe85de..11c969636a8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -54,12 +54,12 @@ public static Schema0Map of(Map arg, SchemaConfiguration configu return Schema0.getInstance().validate(arg, configuration); } - public @NonNull String foo() { + public String foo() { @Nullable Object value = get("foo"); if (!(value instanceof String)) { throw new InvalidTypeException("Invalid value stored for foo"); } - return (@NonNull String) value; + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -216,7 +216,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -445,7 +445,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -684,7 +684,7 @@ public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToI if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index cc4eac209a8..7d33c488a16 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -185,7 +185,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 5791aa4e57c..18c8d9d6bb1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -190,7 +190,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 75b3847a46c..3f75c40259e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -190,7 +190,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index f04cbf1a3fe..57ba4713f5e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -189,7 +189,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index 01a3e10347e..c848f94ac4a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -376,7 +376,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index ffc750b6b19..e45d5c197d6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -215,7 +215,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -282,12 +282,12 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu return Schema1.getInstance().validate(arg, configuration); } - public @NonNull String foo() { + public String foo() { @Nullable Object value = get("foo"); if (!(value instanceof String)) { throw new InvalidTypeException("Invalid value stored for foo"); } - return (@NonNull String) value; + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -444,7 +444,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -643,7 +643,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index 039423d6f38..bfb32680729 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -173,7 +173,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -363,7 +363,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index db218f6e44f..d3edd997d64 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -190,7 +190,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 4f1ba6bd122..d366846c4da 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -180,7 +180,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 7f18ba05c1c..3cae6f23cf0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -180,7 +180,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index 023f1a883d0..dcefc85a6ee 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -180,7 +180,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 409a26fafe2..52bb351656b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index 11f91cafedf..fbe351e557e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index 94e1a9cde9a..c551e3df7c9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -125,22 +125,22 @@ public static EnumsInPropertiesMap of(Map arg, SchemaConfigurati return EnumsInProperties1.getInstance().validate(arg, configuration); } - public @NonNull String bar() { + public String bar() { @Nullable Object value = get("bar"); if (!(value instanceof String)) { throw new InvalidTypeException("Invalid value stored for bar"); } - return (@NonNull String) value; + return (String) value; } - public @NonNull String foo() throws UnsetPropertyException { + public String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); if (!(value instanceof String)) { throw new InvalidTypeException("Invalid value stored for foo"); } - return (@NonNull String) value; + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -190,7 +190,7 @@ public EnumsInPropertiesMap getNewInstance(Map arg, List pathToIte if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index d9a3785cd08..d03e98e5511 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -217,7 +217,7 @@ public ForbiddenPropertyMap getNewInstance(Map arg, List pathToIte if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 9c3c2bc9c2f..83c6bf9f883 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 6bc02f0d848..d52f73be698 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -87,14 +87,14 @@ public static InvalidStringValueForDefaultMap of(Map arg, Schema return InvalidStringValueForDefault1.getInstance().validate(arg, configuration); } - public @NonNull String bar() throws UnsetPropertyException { + public String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); if (!(value instanceof String)) { throw new InvalidTypeException("Invalid value stored for bar"); } - return (@NonNull String) value; + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -254,7 +254,7 @@ public InvalidStringValueForDefaultMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index ab6f8d4a68e..2ad039e9262 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index cf95bc0933a..a4181167bc7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 9227df3d7a4..03a29e0b744 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 2637c207843..2d5f77c739f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 4a9ce87c5a1..c18c5df7baa 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index 664f9260a50..93656943054 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 05563ce9be8..b71bdfdc758 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index e4f2f57c7c3..08df21c2b03 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index 8c99a6dc13d..cdbb2d8356f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index de1025d65b7..31035e31bbd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index 96e2fcd1169..8a7b707b32b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index b0155206030..59cb8abe6aa 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 466023d8008..fa134e136cd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index d747881a33d..56c0417b485 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index cfd253c2747..0f0df27b565 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -377,7 +377,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index 212558c4e74..d1c0e561877 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -377,7 +377,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index 369938e9c45..edc63c92f2b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -28,8 +28,8 @@ public class NestedItems { public static class Items3 extends NumberJsonSchema {} - public static class ItemsList extends FrozenList<@NonNull Number> { - protected ItemsList(FrozenList<@NonNull Number> m) { + public static class ItemsList extends FrozenList { + protected ItemsList(FrozenList m) { super(m); } public static ItemsList of(List arg, SchemaConfiguration configuration) throws ValidationException { @@ -61,7 +61,7 @@ public static Items2 getInstance() { @Override public ItemsList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List<@NonNull Number> items = new ArrayList<>(); + List items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -75,10 +75,10 @@ public ItemsList getNewInstance(List arg, List pathToItem, PathToSche if (!(itemInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); } - items.add((@NonNull Number) itemInstance); + items.add((Number) itemInstance); i += 1; } - FrozenList<@NonNull Number> newInstanceItems = new FrozenList<>(items); + FrozenList newInstanceItems = new FrozenList<>(items); return new ItemsList(newInstanceItems); } @@ -102,8 +102,8 @@ public ItemsList validate(List arg, SchemaConfiguration configuration) t } } - public static class ItemsList1 extends FrozenList<@NonNull ItemsList> { - protected ItemsList1(FrozenList<@NonNull ItemsList> m) { + public static class ItemsList1 extends FrozenList { + protected ItemsList1(FrozenList m) { super(m); } public static ItemsList1 of(List> arg, SchemaConfiguration configuration) throws ValidationException { @@ -135,7 +135,7 @@ public static Items1 getInstance() { @Override public ItemsList1 getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List<@NonNull ItemsList> items = new ArrayList<>(); + List items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -149,10 +149,10 @@ public ItemsList1 getNewInstance(List arg, List pathToItem, PathToSch if (!(itemInstance instanceof ItemsList)) { throw new InvalidTypeException("Invalid instantiated value"); } - items.add((@NonNull ItemsList) itemInstance); + items.add((ItemsList) itemInstance); i += 1; } - FrozenList<@NonNull ItemsList> newInstanceItems = new FrozenList<>(items); + FrozenList newInstanceItems = new FrozenList<>(items); return new ItemsList1(newInstanceItems); } @@ -176,8 +176,8 @@ public ItemsList1 validate(List> arg, SchemaConfiguration configura } } - public static class ItemsList2 extends FrozenList<@NonNull ItemsList1> { - protected ItemsList2(FrozenList<@NonNull ItemsList1> m) { + public static class ItemsList2 extends FrozenList { + protected ItemsList2(FrozenList m) { super(m); } public static ItemsList2 of(List>> arg, SchemaConfiguration configuration) throws ValidationException { @@ -209,7 +209,7 @@ public static Items getInstance() { @Override public ItemsList2 getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List<@NonNull ItemsList1> items = new ArrayList<>(); + List items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -223,10 +223,10 @@ public ItemsList2 getNewInstance(List arg, List pathToItem, PathToSch if (!(itemInstance instanceof ItemsList1)) { throw new InvalidTypeException("Invalid instantiated value"); } - items.add((@NonNull ItemsList1) itemInstance); + items.add((ItemsList1) itemInstance); i += 1; } - FrozenList<@NonNull ItemsList1> newInstanceItems = new FrozenList<>(items); + FrozenList newInstanceItems = new FrozenList<>(items); return new ItemsList2(newInstanceItems); } @@ -250,8 +250,8 @@ public ItemsList2 validate(List>> arg, SchemaConfiguration con } } - public static class NestedItemsList extends FrozenList<@NonNull ItemsList2> { - protected NestedItemsList(FrozenList<@NonNull ItemsList2> m) { + public static class NestedItemsList extends FrozenList { + protected NestedItemsList(FrozenList m) { super(m); } public static NestedItemsList of(List>>> arg, SchemaConfiguration configuration) throws ValidationException { @@ -289,7 +289,7 @@ public static NestedItems1 getInstance() { @Override public NestedItemsList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List<@NonNull ItemsList2> items = new ArrayList<>(); + List items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -303,10 +303,10 @@ public NestedItemsList getNewInstance(List arg, List pathToItem, Path if (!(itemInstance instanceof ItemsList2)) { throw new InvalidTypeException("Invalid instantiated value"); } - items.add((@NonNull ItemsList2) itemInstance); + items.add((ItemsList2) itemInstance); i += 1; } - FrozenList<@NonNull ItemsList2> newInstanceItems = new FrozenList<>(items); + FrozenList newInstanceItems = new FrozenList<>(items); return new NestedItemsList(newInstanceItems); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index 80437b11560..fc3f4b88fd0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -377,7 +377,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index 7c406860a72..734b40a9862 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -183,7 +183,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 8a94b8808da..0b92381c8f6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -52,14 +52,14 @@ public static NotMap of(Map arg, SchemaConfiguration configurati return Not.getInstance().validate(arg, configuration); } - public @NonNull String foo() throws UnsetPropertyException { + public String foo() throws UnsetPropertyException { String key = "foo"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); if (!(value instanceof String)) { throw new InvalidTypeException("Invalid value stored for foo"); } - return (@NonNull String) value; + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -99,7 +99,7 @@ public NotMap getNewInstance(Map arg, List pathToItem, PathToSchem if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -284,7 +284,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index 1d7dd383904..6e543475581 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -67,14 +67,14 @@ public long foo() throws UnsetPropertyException { return (long) value; } - public @NonNull String bar() throws UnsetPropertyException { + public String bar() throws UnsetPropertyException { String key = "bar"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); if (!(value instanceof String)) { throw new InvalidTypeException("Invalid value stored for bar"); } - return (@NonNull String) value; + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -235,7 +235,7 @@ public ObjectPropertiesValidationMap getNewInstance(Map arg, List if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index 8662d6b473d..1e207a768cc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -177,7 +177,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -376,7 +376,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index fcb9eb76185..f3886edba3c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -215,7 +215,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -282,12 +282,12 @@ public static Schema1Map of(Map arg, SchemaConfiguration configu return Schema1.getInstance().validate(arg, configuration); } - public @NonNull String foo() { + public String foo() { @Nullable Object value = get("foo"); if (!(value instanceof String)) { throw new InvalidTypeException("Invalid value stored for foo"); } - return (@NonNull String) value; + return (String) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -444,7 +444,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -643,7 +643,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index cb7180637ee..4b41e545019 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -173,7 +173,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -363,7 +363,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 69435a3765a..66559e81fc6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -190,7 +190,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 10d456289a1..6403f108cd4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -208,7 +208,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -433,7 +433,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -518,7 +518,7 @@ public static OneofWithRequired1 getInstance() { if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index 170815ee333..f0a65822396 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -182,7 +182,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index f61f3f68224..1cd57f3217c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -182,7 +182,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 806ab0b27a2..b0673f0d47a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -234,7 +234,7 @@ public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 78a7ccea3bb..20eba3a12bc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -209,7 +209,7 @@ public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 7448e0fd5f8..5ae740268eb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -76,7 +76,7 @@ public RefInAdditionalpropertiesMap getNewInstance(Map arg, List p if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index 034165ecf36..c628f2051ed 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -181,7 +181,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index 8f0f09e0547..f73926e8f43 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -181,7 +181,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index 4763aeb8b40..a4002580f49 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index ae70c311fd4..577c2a9f882 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -181,7 +181,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index ad5deb97acf..8059dade18c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -215,7 +215,7 @@ public RefInPropertyMap getNewInstance(Map arg, List pathToItem, P if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 971ff8dc307..0523cf9da88 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -215,7 +215,7 @@ public RequiredDefaultValidationMap getNewInstance(Map arg, List p if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index fc92ce86c79..1c2ed6a88d8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -228,7 +228,7 @@ public RequiredValidationMap getNewInstance(Map arg, List pathToIt if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index c30118b2875..b8cd82a726b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -215,7 +215,7 @@ public RequiredWithEmptyArrayMap getNewInstance(Map arg, List path if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index 3608517c70d..e3132b57ed4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -214,7 +214,7 @@ public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index effc9e35921..9f4c9c6ca30 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -97,14 +97,14 @@ public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap of(Map return TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1.getInstance().validate(arg, configuration); } - public @NonNull Number alpha() throws UnsetPropertyException { + public Number alpha() throws UnsetPropertyException { String key = "alpha"; throwIfKeyNotPresent(key); @Nullable Object value = get(key); if (!(value instanceof Number)) { throw new InvalidTypeException("Invalid value stored for alpha"); } - return (@NonNull Number) value; + return (Number) value; } public @Nullable Object getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException { @@ -150,7 +150,7 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap getNewInstanc if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index 9ccd156cb6d..9474f66024d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 08a833b31b4..ff8835ee713 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index c50f91f7a00..1868cda502c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index a4a819fcd6e..8ad6032fe9d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index 1e89e599423..705d9bbe19d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index aaae6e7f054..d9f6c0995d2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -16,7 +16,6 @@ import org.openapijsonschematools.client.schemas.validation.ListSchemaValidator; import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; @@ -165,7 +164,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java index 69773b620f9..b8a7f2dfc75 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java @@ -11,7 +11,6 @@ import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator; import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java index 063934fa21b..c32c7ed9a66 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -9,7 +9,6 @@ import org.openapijsonschematools.client.schemas.validation.StringSchemaValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; @@ -39,12 +38,12 @@ public static DateJsonSchema getInstance() { } @Override - public @NonNull String getNewInstance(@NonNull String arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public String getNewInstance(String arg, List pathToItem, PathToSchemasMap pathToSchemas) { return arg; } @Override - public @NonNull String validate(@NonNull String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public String validate(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); String castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -54,7 +53,7 @@ public static DateJsonSchema getInstance() { return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); } - public @NonNull String validate(@NonNull LocalDate arg, SchemaConfiguration configuration) throws ValidationException { + public String validate(LocalDate arg, SchemaConfiguration configuration) throws ValidationException { return validate(arg.toString(), configuration); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java index 440ac05aa0b..40678438e46 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java @@ -12,7 +12,6 @@ import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.ZonedDateTime; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java index fad2a9424a5..c054b61ba89 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java @@ -12,7 +12,6 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java index 760eae85a29..5e05b11ca82 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java @@ -12,7 +12,6 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java index 599fa3a1ffd..8892622fe0e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java @@ -12,7 +12,6 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java index 7f0bef1fe68..af996f5b34c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java @@ -12,7 +12,6 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java index dbf21d5a5b8..891b0d078ed 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java @@ -12,7 +12,6 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java index 39b53f5c306..26b7195ee4c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java @@ -12,7 +12,6 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index 9098dec1cae..5202b5aa070 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -10,7 +10,6 @@ import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; @@ -46,7 +45,7 @@ public static MapJsonSchema getInstance() { if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index 73046835f2c..7e91749e7ad 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -16,7 +16,6 @@ import org.openapijsonschematools.client.schemas.validation.ListSchemaValidator; import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; @@ -167,7 +166,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java index d98deb843d9..3611bc9e230 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java @@ -11,7 +11,6 @@ import org.openapijsonschematools.client.schemas.validation.NullSchemaValidator; import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java index a64f02a6138..734c9ea6148 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java @@ -11,7 +11,6 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java index a3a1df15a66..e8ae4b8027f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java @@ -11,7 +11,6 @@ import org.openapijsonschematools.client.schemas.validation.TypeValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java index 5347eca26e2..d7f55dc445f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java @@ -12,7 +12,6 @@ import org.openapijsonschematools.client.schemas.validation.FormatValidator; import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java index 03ad5a13bb5..a24276efe3c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/FrozenMap.java @@ -1,7 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; import org.checkerframework.checker.nullness.qual.KeyFor; -import org.checkerframework.checker.nullness.qual.NonNull; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.InvalidAdditionalPropertyException; @@ -37,7 +36,7 @@ protected void throwIfKeyKnown(String key, Set requiredKeys, Set } @Override - public @NonNull Set> entrySet() { + public Set> entrySet() { return map.entrySet().stream() .map(x -> new AbstractMap.SimpleEntry<>(x.getKey(), x.getValue())) .collect(Collectors.toSet()); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 36c652e2311..7b2dd027212 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -2,7 +2,6 @@ import org.openapijsonschematools.client.exceptions.ValidationException; import org.openapijsonschematools.client.exceptions.InvalidTypeException; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; @@ -42,7 +41,7 @@ public abstract class JsonSchema { public final @Nullable Boolean uniqueItems; public final @Nullable Set<@Nullable Object> enumValues; public final @Nullable Pattern pattern; - private final @NonNull LinkedHashMap keywordToValidator; + private final LinkedHashMap keywordToValidator; protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { LinkedHashMap keywordToValidator = new LinkedHashMap<>(); @@ -296,7 +295,7 @@ protected List castToAllowedTypes(List arg, List pathToItem, Set newPathToItem = new ArrayList<>(pathToItem); newPathToItem.add(key); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java index 4e9b537b1ae..21e04cb8bd0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java @@ -1,6 +1,5 @@ package org.openapijsonschematools.client.schemas.validation; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.lang.reflect.InvocationTargetException; @@ -20,9 +19,9 @@ public static V getInstance(Class schemaCls) { } try { Method method = schemaCls.getMethod("getInstance"); - @SuppressWarnings("nullness") @NonNull Object obj = method.invoke(null); + @SuppressWarnings("nullness") Object obj = method.invoke(null); assert schemaCls.isInstance(obj); - @NonNull V inst = schemaCls.cast(obj); + V inst = schemaCls.cast(obj); classToInstance.put(schemaCls, inst); return inst; } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java index cb6e84cb8d1..3685df5d0bb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java @@ -1,5 +1,4 @@ package org.openapijsonschematools.client.schemas.validation; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; @@ -10,122 +9,122 @@ public class JsonSchemaInfo { public @Nullable Set> type = null; - public JsonSchemaInfo type(@NonNull Set> type) { + public JsonSchemaInfo type(Set> type) { this.type = type; return this; } public @Nullable String format = null; - public JsonSchemaInfo format(@NonNull String format) { + public JsonSchemaInfo format(String format) { this.format = format; return this; } public @Nullable Class items = null; - public JsonSchemaInfo items(@NonNull Class items) { + public JsonSchemaInfo items(Class items) { this.items = items; return this; } public @Nullable Map> properties = null; - public JsonSchemaInfo properties(@NonNull Map> properties) { + public JsonSchemaInfo properties(Map> properties) { this.properties = properties; return this; } public @Nullable Set required = null; - public JsonSchemaInfo required(@NonNull Set required) { + public JsonSchemaInfo required(Set required) { this.required = required; return this; } public @Nullable Number exclusiveMaximum = null; - public JsonSchemaInfo exclusiveMaximum(@NonNull Number exclusiveMaximum) { + public JsonSchemaInfo exclusiveMaximum(Number exclusiveMaximum) { this.exclusiveMaximum = exclusiveMaximum; return this; } public @Nullable Number exclusiveMinimum = null; - public JsonSchemaInfo exclusiveMinimum(@NonNull Number exclusiveMinimum) { + public JsonSchemaInfo exclusiveMinimum(Number exclusiveMinimum) { this.exclusiveMinimum = exclusiveMinimum; return this; } public @Nullable Integer maxItems = null; - public JsonSchemaInfo maxItems(@NonNull Integer maxItems) { + public JsonSchemaInfo maxItems(Integer maxItems) { this.maxItems = maxItems; return this; } public @Nullable Integer minItems = null; - public JsonSchemaInfo minItems(@NonNull Integer minItems) { + public JsonSchemaInfo minItems(Integer minItems) { this.minItems = minItems; return this; } public @Nullable Integer maxLength = null; - public JsonSchemaInfo maxLength(@NonNull Integer maxLength) { + public JsonSchemaInfo maxLength(Integer maxLength) { this.maxLength = maxLength; return this; } public @Nullable Integer minLength = null; - public JsonSchemaInfo minLength(@NonNull Integer minLength) { + public JsonSchemaInfo minLength(Integer minLength) { this.minLength = minLength; return this; } public @Nullable Integer maxProperties = null; - public JsonSchemaInfo maxProperties(@NonNull Integer maxProperties) { + public JsonSchemaInfo maxProperties(Integer maxProperties) { this.maxProperties = maxProperties; return this; } public @Nullable Integer minProperties = null; - public JsonSchemaInfo minProperties(@NonNull Integer minProperties) { + public JsonSchemaInfo minProperties(Integer minProperties) { this.minProperties = minProperties; return this; } public @Nullable Number maximum = null; - public JsonSchemaInfo maximum(@NonNull Number maximum) { + public JsonSchemaInfo maximum(Number maximum) { this.maximum = maximum; return this; } public @Nullable Number minimum = null; - public JsonSchemaInfo minimum(@NonNull Number minimum) { + public JsonSchemaInfo minimum(Number minimum) { this.minimum = minimum; return this; } public @Nullable BigDecimal multipleOf = null; - public JsonSchemaInfo multipleOf(@NonNull BigDecimal multipleOf) { + public JsonSchemaInfo multipleOf(BigDecimal multipleOf) { this.multipleOf = multipleOf; return this; } public @Nullable Class additionalProperties; - public JsonSchemaInfo additionalProperties(@NonNull Class additionalProperties) { + public JsonSchemaInfo additionalProperties(Class additionalProperties) { this.additionalProperties = additionalProperties; return this; } public @Nullable List> allOf = null; - public JsonSchemaInfo allOf(@NonNull List> allOf) { + public JsonSchemaInfo allOf(List> allOf) { this.allOf = allOf; return this; } public @Nullable List> anyOf = null; - public JsonSchemaInfo anyOf(@NonNull List> anyOf) { + public JsonSchemaInfo anyOf(List> anyOf) { this.anyOf = anyOf; return this; } public @Nullable List> oneOf = null; - public JsonSchemaInfo oneOf(@NonNull List> oneOf) { + public JsonSchemaInfo oneOf(List> oneOf) { this.oneOf = oneOf; return this; } public @Nullable Class not = null; - public JsonSchemaInfo not(@NonNull Class not) { + public JsonSchemaInfo not(Class not) { this.not = not; return this; } public @Nullable Boolean uniqueItems = null; - public JsonSchemaInfo uniqueItems(@NonNull Boolean uniqueItems) { + public JsonSchemaInfo uniqueItems(Boolean uniqueItems) { this.uniqueItems = uniqueItems; return this; } public @Nullable Set<@Nullable Object> enumValues = null; - public JsonSchemaInfo enumValues(@NonNull Set<@Nullable Object> enumValues) { + public JsonSchemaInfo enumValues(Set<@Nullable Object> enumValues) { this.enumValues = enumValues; return this; } public @Nullable Pattern pattern = null; - public JsonSchemaInfo pattern(@NonNull Pattern pattern) { + public JsonSchemaInfo pattern(Pattern pattern) { this.pattern = pattern; return this; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index 2d114f921e6..1e3e37546e7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -4,7 +4,6 @@ import org.openapijsonschematools.client.configurations.SchemaConfiguration; import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.ValidationException; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; @@ -153,7 +152,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java index c23b81920eb..8d83f3b6207 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java @@ -1,6 +1,5 @@ package org.openapijsonschematools.client.schemas.validation; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.configurations.SchemaConfiguration; import java.util.List; @@ -10,7 +9,7 @@ public record ValidationMetadata( List pathToItem, SchemaConfiguration configuration, - @NonNull PathToSchemasMap validatedPathToSchemas, + PathToSchemasMap validatedPathToSchemas, Set> seenClasses ) { diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java index 0623ceeb056..d9776b84ecc 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java @@ -1,6 +1,5 @@ package org.openapijsonschematools.client.schemas; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; @@ -32,7 +31,7 @@ public class ArrayTypeSchemaTest { new LinkedHashSet<>() ); - public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator> { + public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator> { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -41,8 +40,8 @@ public ArrayWithItemsSchema() { } @Override - public FrozenList<@NonNull String> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List<@NonNull String> items = new ArrayList<>(); + public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -56,14 +55,14 @@ public ArrayWithItemsSchema() { if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); } - items.add((@NonNull String) castItem); + items.add((String) castItem); i += 1; } return new FrozenList<>(items); } @Override - public FrozenList<@NonNull String> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -82,8 +81,8 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } } - public static class ArrayWithOutputClsSchemaList extends FrozenList<@NonNull String> { - protected ArrayWithOutputClsSchemaList(FrozenList<@NonNull String> m) { + public static class ArrayWithOutputClsSchemaList extends FrozenList { + protected ArrayWithOutputClsSchemaList(FrozenList m) { super(m); } @@ -103,7 +102,7 @@ public ArrayWithOutputClsSchema() { @Override public ArrayWithOutputClsSchemaList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List<@NonNull String> items = new ArrayList<>(); + List items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -117,10 +116,10 @@ public ArrayWithOutputClsSchemaList getNewInstance(List arg, List pat if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); } - items.add((@NonNull String) castItem); + items.add((String) castItem); i += 1; } - FrozenList<@NonNull String> newInstanceItems = new FrozenList<>(items); + FrozenList newInstanceItems = new FrozenList<>(items); return new ArrayWithOutputClsSchemaList(newInstanceItems); } diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java index 726458a6934..4d5d445aaa2 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java @@ -103,4 +103,3 @@ public void testIncorrectPropertyValueFails() { )); } } - diff --git a/src/main/resources/java/pom.hbs b/src/main/resources/java/pom.hbs index c751b7ad6d9..b44657d7801 100644 --- a/src/main/resources/java/pom.hbs +++ b/src/main/resources/java/pom.hbs @@ -241,7 +241,7 @@ ${swagger-annotations-version} - + org.checkerframework checker-qual diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs index 33e4e9d02a9..a10167c3cb4 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs @@ -22,7 +22,7 @@ public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.camelCase}}{ if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); @@ -358,7 +358,7 @@ public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else} if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs index 26eef17dceb..fdc8ceb5ded 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_output_type_base.hbs @@ -3,7 +3,7 @@ {{#each types}} {{#eq this "boolean"}} {{#if forceNull}} -{{#unless noAnnotations}}@NonNull {{/unless}}Boolean +Boolean {{~else}} boolean {{~/if}} @@ -16,37 +16,37 @@ Void {{! todo binary types}} String {{~else}} -{{#unless noAnnotations}}@NonNull {{/unless}}String +String {{~/eq}} {{else}} {{#eq this "number"}} {{#eq ../format null}} -{{#unless noAnnotations}}@NonNull {{/unless}}Number +Number {{~else}} {{#eq ../format "float"}} {{#if forceNull}} -{{#unless noAnnotations}}@NonNull {{/unless}}Float +Float {{~else}} float {{~/if}} {{else}} {{#eq ../format "double"}} {{#if forceNull}} -{{#unless noAnnotations}}@NonNull {{/unless}}Double +Double {{~else}} double {{~/if}} {{else}} {{#eq ../format "int32"}} {{#if forceNull}} -{{#unless noAnnotations}}@NonNull {{/unless}}Integer +Integer {{~else}} int {{~/if}} {{else}} {{#eq ../format "int64"}} {{#if forceNull}} -{{#unless noAnnotations}}@NonNull {{/unless}}Long +Long {{~else}} long {{~/if}} @@ -59,21 +59,21 @@ long {{#eq this "integer"}} {{#eq ../format null}} {{#if forceNull}} -{{#unless noAnnotations}}@NonNull {{/unless}}Long +Long {{~else}} long {{~/if}} {{else}} {{#eq ../format "int32"}} {{#if forceNull}} -{{#unless noAnnotations}}@NonNull {{/unless}}Integer +Integer {{~else}} int {{~/if}} {{else}} {{#eq ../format "int64"}} {{#if forceNull}} -{{#unless noAnnotations}}@NonNull {{/unless}}Long +Long {{~else}} long {{~/if}} @@ -91,13 +91,13 @@ long {{~/if}} {{else}} {{#if fullRefModule}} -{{#unless noAnnotations}}@NonNull {{/unless}}{{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}} +{{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}} {{~else}} -{{#unless noAnnotations}}@NonNull {{/unless}}{{arrayOutputJsonPathPiece.camelCase}} +{{arrayOutputJsonPathPiece.camelCase}} {{~/if}} {{/if}} {{else}} -{{#unless noAnnotations}}@NonNull {{/unless}}FrozenList<@Nullable Object> +FrozenList<@Nullable Object> {{~/if}} {{else}} {{#eq this "object"}} @@ -110,13 +110,13 @@ long {{~/if}} {{else}} {{#if fullRefModule}} -{{#unless noAnnotations}}@NonNull {{/unless}}{{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}} +{{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}} {{~else}} -{{#unless noAnnotations}}@NonNull {{/unless}}{{mapOutputJsonPathPiece.camelCase}} +{{mapOutputJsonPathPiece.camelCase}} {{~/if}} {{/if}} {{~else}} -{{#unless noAnnotations}}@NonNull {{/unless}}FrozenMap<@Nullable Object> +FrozenMap<@Nullable Object> {{~/if}} {{/eq}} {{/eq}} diff --git a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs index 017c41f3f10..bb83e0a9f44 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs @@ -16,7 +16,6 @@ import {{{packageName}}}.schemas.validation.StringSchemaValidator; import {{{packageName}}}.schemas.validation.ListSchemaValidator; import {{{packageName}}}.schemas.validation.MapSchemaValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; @@ -165,7 +164,7 @@ public class AnyTypeJsonSchema extends JsonSchema implements NullSchemaValidator if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs index df7d788b99b..44d1995e865 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs @@ -11,7 +11,6 @@ import {{{packageName}}}.schemas.validation.PathToSchemasMap; import {{{packageName}}}.schemas.validation.BooleanSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs index 5172c93c34a..eccfd1ff3b4 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs @@ -9,7 +9,6 @@ import {{{packageName}}}.schemas.validation.PathToSchemasMap; import {{{packageName}}}.schemas.validation.StringSchemaValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; @@ -39,12 +38,12 @@ public class DateJsonSchema extends JsonSchema implements StringSchemaValidator } @Override - public @NonNull String getNewInstance(@NonNull String arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public String getNewInstance(String arg, List pathToItem, PathToSchemasMap pathToSchemas) { return arg; } @Override - public @NonNull String validate(@NonNull String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public String validate(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); String castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -54,7 +53,7 @@ public class DateJsonSchema extends JsonSchema implements StringSchemaValidator return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); } - public @NonNull String validate(@NonNull LocalDate arg, SchemaConfiguration configuration) throws ValidationException { + public String validate(LocalDate arg, SchemaConfiguration configuration) throws ValidationException { return validate(arg.toString(), configuration); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs index 4ba67fbc498..5aba00371d8 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs @@ -12,7 +12,6 @@ import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.ZonedDateTime; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs index 70667187222..cca823bb998 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs @@ -12,7 +12,6 @@ import {{{packageName}}}.schemas.validation.StringSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs index 4409b6b1c31..4d873a97bc6 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs @@ -12,7 +12,6 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs index fabd570ba23..6f3109500dc 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs @@ -12,7 +12,6 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs index f6dfe32c340..7b8fce601f0 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs @@ -12,7 +12,6 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs index 0521c8989fd..516755a0bfc 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs @@ -12,7 +12,6 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs index 366bb00daf1..6579e8661a9 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs @@ -12,7 +12,6 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs index 3402c700de9..a225b22c810 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs @@ -10,7 +10,6 @@ import {{{packageName}}}.schemas.validation.PathToSchemasMap; import {{{packageName}}}.schemas.validation.MapSchemaValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; @@ -46,7 +45,7 @@ public class MapJsonSchema extends JsonSchema implements MapSchemaValidator propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs index dfdb1024a25..a9c40f211bf 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs @@ -16,7 +16,6 @@ import {{{packageName}}}.schemas.validation.StringSchemaValidator; import {{{packageName}}}.schemas.validation.ListSchemaValidator; import {{{packageName}}}.schemas.validation.MapSchemaValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; @@ -167,7 +166,7 @@ public class NotAnyTypeJsonSchema extends JsonSchema implements NullSchemaValida if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs index 1869774be03..3d30e412600 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs @@ -11,7 +11,6 @@ import {{{packageName}}}.schemas.validation.PathToSchemasMap; import {{{packageName}}}.schemas.validation.NullSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs index 8916611de42..ac63343aacd 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs @@ -11,7 +11,6 @@ import {{{packageName}}}.schemas.validation.NumberSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs index e3a300d8520..739f443b5ba 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs @@ -11,7 +11,6 @@ import {{{packageName}}}.schemas.validation.StringSchemaValidator; import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs index 654032a74f9..1f8ce915139 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs @@ -12,7 +12,6 @@ import {{{packageName}}}.schemas.validation.TypeValidator; import {{{packageName}}}.schemas.validation.FormatValidator; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.schemas.validation.ValidationMetadata; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.HashSet; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs index f96db564bf1..38f76b622b7 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/FrozenMap.hbs @@ -1,7 +1,6 @@ package {{{packageName}}}.schemas.validation; import org.checkerframework.checker.nullness.qual.KeyFor; -import org.checkerframework.checker.nullness.qual.NonNull; import {{{packageName}}}.exceptions.UnsetPropertyException; import {{{packageName}}}.exceptions.InvalidAdditionalPropertyException; @@ -37,7 +36,7 @@ public class FrozenMap extends AbstractMap { } @Override - public @NonNull Set> entrySet() { + public Set> entrySet() { return map.entrySet().stream() .map(x -> new AbstractMap.SimpleEntry<>(x.getKey(), x.getValue())) .collect(Collectors.toSet()); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index a5e4d8312ce..d6c63cee579 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -2,7 +2,6 @@ package {{{packageName}}}.schemas.validation; import {{{packageName}}}.exceptions.ValidationException; import {{{packageName}}}.exceptions.InvalidTypeException; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; @@ -42,7 +41,7 @@ public abstract class JsonSchema { public final @Nullable Boolean uniqueItems; public final @Nullable Set<@Nullable Object> enumValues; public final @Nullable Pattern pattern; - private final @NonNull LinkedHashMap keywordToValidator; + private final LinkedHashMap keywordToValidator; protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { LinkedHashMap keywordToValidator = new LinkedHashMap<>(); @@ -296,7 +295,7 @@ public abstract class JsonSchema { if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String key = (@NonNull String) entryKey; + String key = (String) entryKey; Object val = entry.getValue(); List newPathToItem = new ArrayList<>(pathToItem); newPathToItem.add(key); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs index 66de5d961b5..8c85464dbcb 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs @@ -1,6 +1,5 @@ package {{{packageName}}}.schemas.validation; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.lang.reflect.InvocationTargetException; @@ -20,9 +19,9 @@ public class JsonSchemaFactory { } try { Method method = schemaCls.getMethod("getInstance"); - @SuppressWarnings("nullness") @NonNull Object obj = method.invoke(null); + @SuppressWarnings("nullness") Object obj = method.invoke(null); assert schemaCls.isInstance(obj); - @NonNull V inst = schemaCls.cast(obj); + V inst = schemaCls.cast(obj); classToInstance.put(schemaCls, inst); return inst; } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs index 505c805e4cc..ccd26fb5bf3 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs @@ -1,5 +1,4 @@ package {{{packageName}}}.schemas.validation; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.math.BigDecimal; @@ -10,122 +9,122 @@ import java.util.regex.Pattern; public class JsonSchemaInfo { public @Nullable Set> type = null; - public JsonSchemaInfo type(@NonNull Set> type) { + public JsonSchemaInfo type(Set> type) { this.type = type; return this; } public @Nullable String format = null; - public JsonSchemaInfo format(@NonNull String format) { + public JsonSchemaInfo format(String format) { this.format = format; return this; } public @Nullable Class items = null; - public JsonSchemaInfo items(@NonNull Class items) { + public JsonSchemaInfo items(Class items) { this.items = items; return this; } public @Nullable Map> properties = null; - public JsonSchemaInfo properties(@NonNull Map> properties) { + public JsonSchemaInfo properties(Map> properties) { this.properties = properties; return this; } public @Nullable Set required = null; - public JsonSchemaInfo required(@NonNull Set required) { + public JsonSchemaInfo required(Set required) { this.required = required; return this; } public @Nullable Number exclusiveMaximum = null; - public JsonSchemaInfo exclusiveMaximum(@NonNull Number exclusiveMaximum) { + public JsonSchemaInfo exclusiveMaximum(Number exclusiveMaximum) { this.exclusiveMaximum = exclusiveMaximum; return this; } public @Nullable Number exclusiveMinimum = null; - public JsonSchemaInfo exclusiveMinimum(@NonNull Number exclusiveMinimum) { + public JsonSchemaInfo exclusiveMinimum(Number exclusiveMinimum) { this.exclusiveMinimum = exclusiveMinimum; return this; } public @Nullable Integer maxItems = null; - public JsonSchemaInfo maxItems(@NonNull Integer maxItems) { + public JsonSchemaInfo maxItems(Integer maxItems) { this.maxItems = maxItems; return this; } public @Nullable Integer minItems = null; - public JsonSchemaInfo minItems(@NonNull Integer minItems) { + public JsonSchemaInfo minItems(Integer minItems) { this.minItems = minItems; return this; } public @Nullable Integer maxLength = null; - public JsonSchemaInfo maxLength(@NonNull Integer maxLength) { + public JsonSchemaInfo maxLength(Integer maxLength) { this.maxLength = maxLength; return this; } public @Nullable Integer minLength = null; - public JsonSchemaInfo minLength(@NonNull Integer minLength) { + public JsonSchemaInfo minLength(Integer minLength) { this.minLength = minLength; return this; } public @Nullable Integer maxProperties = null; - public JsonSchemaInfo maxProperties(@NonNull Integer maxProperties) { + public JsonSchemaInfo maxProperties(Integer maxProperties) { this.maxProperties = maxProperties; return this; } public @Nullable Integer minProperties = null; - public JsonSchemaInfo minProperties(@NonNull Integer minProperties) { + public JsonSchemaInfo minProperties(Integer minProperties) { this.minProperties = minProperties; return this; } public @Nullable Number maximum = null; - public JsonSchemaInfo maximum(@NonNull Number maximum) { + public JsonSchemaInfo maximum(Number maximum) { this.maximum = maximum; return this; } public @Nullable Number minimum = null; - public JsonSchemaInfo minimum(@NonNull Number minimum) { + public JsonSchemaInfo minimum(Number minimum) { this.minimum = minimum; return this; } public @Nullable BigDecimal multipleOf = null; - public JsonSchemaInfo multipleOf(@NonNull BigDecimal multipleOf) { + public JsonSchemaInfo multipleOf(BigDecimal multipleOf) { this.multipleOf = multipleOf; return this; } public @Nullable Class additionalProperties; - public JsonSchemaInfo additionalProperties(@NonNull Class additionalProperties) { + public JsonSchemaInfo additionalProperties(Class additionalProperties) { this.additionalProperties = additionalProperties; return this; } public @Nullable List> allOf = null; - public JsonSchemaInfo allOf(@NonNull List> allOf) { + public JsonSchemaInfo allOf(List> allOf) { this.allOf = allOf; return this; } public @Nullable List> anyOf = null; - public JsonSchemaInfo anyOf(@NonNull List> anyOf) { + public JsonSchemaInfo anyOf(List> anyOf) { this.anyOf = anyOf; return this; } public @Nullable List> oneOf = null; - public JsonSchemaInfo oneOf(@NonNull List> oneOf) { + public JsonSchemaInfo oneOf(List> oneOf) { this.oneOf = oneOf; return this; } public @Nullable Class not = null; - public JsonSchemaInfo not(@NonNull Class not) { + public JsonSchemaInfo not(Class not) { this.not = not; return this; } public @Nullable Boolean uniqueItems = null; - public JsonSchemaInfo uniqueItems(@NonNull Boolean uniqueItems) { + public JsonSchemaInfo uniqueItems(Boolean uniqueItems) { this.uniqueItems = uniqueItems; return this; } public @Nullable Set<@Nullable Object> enumValues = null; - public JsonSchemaInfo enumValues(@NonNull Set<@Nullable Object> enumValues) { + public JsonSchemaInfo enumValues(Set<@Nullable Object> enumValues) { this.enumValues = enumValues; return this; } public @Nullable Pattern pattern = null; - public JsonSchemaInfo pattern(@NonNull Pattern pattern) { + public JsonSchemaInfo pattern(Pattern pattern) { this.pattern = pattern; return this; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs index ccaa1468e1b..ce1312f884e 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs @@ -4,7 +4,6 @@ import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; import {{{packageName}}}.configurations.SchemaConfiguration; import {{{packageName}}}.exceptions.InvalidTypeException; import {{{packageName}}}.exceptions.ValidationException; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.time.LocalDate; @@ -153,7 +152,7 @@ public class UnsetAnyTypeJsonSchema extends JsonSchema implements NullSchemaVali if (!(entryKey instanceof String)) { throw new InvalidTypeException("Invalid non-string key value"); } - @NonNull String propertyName = (@NonNull String) entryKey; + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs index 77f90700785..a868e40d0b2 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs @@ -1,6 +1,5 @@ package {{{packageName}}}.schemas.validation; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import {{{packageName}}}.configurations.SchemaConfiguration; import java.util.List; @@ -10,7 +9,7 @@ import java.util.Set; public record ValidationMetadata( List pathToItem, SchemaConfiguration configuration, - @NonNull PathToSchemasMap validatedPathToSchemas, + PathToSchemasMap validatedPathToSchemas, Set> seenClasses ) { diff --git a/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs index 9fe2805c771..01c63b79c67 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs @@ -1,6 +1,5 @@ package {{{packageName}}}.schemas; -import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; @@ -32,7 +31,7 @@ public class ArrayTypeSchemaTest { new LinkedHashSet<>() ); - public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator> { + public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator> { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -41,8 +40,8 @@ public class ArrayTypeSchemaTest { } @Override - public FrozenList<@NonNull String> getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List<@NonNull String> items = new ArrayList<>(); + public FrozenList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { + List items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -56,14 +55,14 @@ public class ArrayTypeSchemaTest { if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); } - items.add((@NonNull String) castItem); + items.add((String) castItem); i += 1; } return new FrozenList<>(items); } @Override - public FrozenList<@NonNull String> validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenList validate(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -82,8 +81,8 @@ public class ArrayTypeSchemaTest { } } - public static class ArrayWithOutputClsSchemaList extends FrozenList<@NonNull String> { - protected ArrayWithOutputClsSchemaList(FrozenList<@NonNull String> m) { + public static class ArrayWithOutputClsSchemaList extends FrozenList { + protected ArrayWithOutputClsSchemaList(FrozenList m) { super(m); } @@ -103,7 +102,7 @@ public class ArrayTypeSchemaTest { @Override public ArrayWithOutputClsSchemaList getNewInstance(List arg, List pathToItem, PathToSchemasMap pathToSchemas) { - List<@NonNull String> items = new ArrayList<>(); + List items = new ArrayList<>(); int i = 0; for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); @@ -117,10 +116,10 @@ public class ArrayTypeSchemaTest { if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); } - items.add((@NonNull String) castItem); + items.add((String) castItem); i += 1; } - FrozenList<@NonNull String> newInstanceItems = new FrozenList<>(items); + FrozenList newInstanceItems = new FrozenList<>(items); return new ArrayWithOutputClsSchemaList(newInstanceItems); } From 0861f53c58b7432a160cf43eea12522593099c83 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 15:43:19 -0800 Subject: [PATCH 50/52] Adds back one needed NonNull --- .../client/schemas/validation/JsonSchemaFactory.java | 3 ++- .../java/packagename/schemas/validation/JsonSchemaFactory.hbs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java index 21e04cb8bd0..7c9b6402f2b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas.validation; +import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.lang.reflect.InvocationTargetException; @@ -19,7 +20,7 @@ public static V getInstance(Class schemaCls) { } try { Method method = schemaCls.getMethod("getInstance"); - @SuppressWarnings("nullness") Object obj = method.invoke(null); + @SuppressWarnings("nullness") @NonNull Object obj = method.invoke(null); assert schemaCls.isInstance(obj); V inst = schemaCls.cast(obj); classToInstance.put(schemaCls, inst); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs index 8c85464dbcb..2ea8c56b4fe 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas.validation; +import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.lang.reflect.InvocationTargetException; @@ -19,7 +20,7 @@ public class JsonSchemaFactory { } try { Method method = schemaCls.getMethod("getInstance"); - @SuppressWarnings("nullness") Object obj = method.invoke(null); + @SuppressWarnings("nullness") @NonNull Object obj = method.invoke(null); assert schemaCls.isInstance(obj); V inst = schemaCls.cast(obj); classToInstance.put(schemaCls, inst); From 6a41194890bf04f447c5f9c4fd2b99a3fb46c80b Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 16:00:55 -0800 Subject: [PATCH 51/52] Adds ObjectTypeSchemaTest --- .../client/schemas/ObjectTypeSchemaTest.java | 113 ++++++++++++------ .../schemas/ObjectTypeSchemaTest.hbs | 113 ++++++++++++------ 2 files changed, 148 insertions(+), 78 deletions(-) diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java index 76872ad89fc..aafcd102b13 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java @@ -1,5 +1,6 @@ package org.openapijsonschematools.client.schemas; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; @@ -23,7 +24,6 @@ import java.util.Objects; import java.util.Set; - public class ObjectTypeSchemaTest { static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); static final ValidationMetadata validationMetadata = new ValidationMetadata( @@ -33,8 +33,8 @@ public class ObjectTypeSchemaTest { new LinkedHashSet<>() ); - public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator> { - private static ObjectWithPropsSchema instance; + public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator> { + private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -53,22 +53,30 @@ public static ObjectWithPropsSchema getInstance() { } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new InvalidTypeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -79,16 +87,16 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } public static class ObjectWithAddpropsSchema extends JsonSchema implements MapSchemaValidator> { - private static ObjectWithAddpropsSchema instance; + private static @Nullable ObjectWithAddpropsSchema instance = null; private ObjectWithAddpropsSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -107,13 +115,24 @@ public static ObjectWithAddpropsSchema getInstance() { public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new InvalidTypeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - String castValue = (String) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(castValue instanceof String)) { + throw new InvalidTypeException("Invalid type for property value"); + } + properties.put(propertyName, (String) castValue); } return new FrozenMap<>(properties); } @@ -130,17 +149,17 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { @SuppressWarnings("unchecked") FrozenMap castArg = (FrozenMap) arg; return getNewInstance(castArg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } - public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator> { - private static ObjectWithPropsAndAddpropsSchema instance; + public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator> { + private static @Nullable ObjectWithPropsAndAddpropsSchema instance = null; private ObjectWithPropsAndAddpropsSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -159,22 +178,30 @@ public static ObjectWithPropsAndAddpropsSchema getInstance() { } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new InvalidTypeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -185,17 +212,17 @@ public FrozenMap validate(Map arg, SchemaConfiguration c } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { @SuppressWarnings("unchecked") FrozenMap castArg = (FrozenMap) arg; return getNewInstance(castArg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } - public static class ObjectWithOutputTypeSchemaMap extends FrozenMap { - protected ObjectWithOutputTypeSchemaMap(FrozenMap m) { + public static class ObjectWithOutputTypeSchemaMap extends FrozenMap<@Nullable Object> { + protected ObjectWithOutputTypeSchemaMap(FrozenMap<@Nullable Object> m) { super(m); } @@ -206,7 +233,7 @@ public static ObjectWithOutputTypeSchemaMap of(Map arg, SchemaCo public static class ObjectWithOutputTypeSchema extends JsonSchema implements MapSchemaValidator { - private static ObjectWithOutputTypeSchema instance; + private static @Nullable ObjectWithOutputTypeSchema instance = null; public ObjectWithOutputTypeSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -225,14 +252,22 @@ public static ObjectWithOutputTypeSchema getInstance() { @Override public ObjectWithOutputTypeSchemaMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new InvalidTypeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new ObjectWithOutputTypeSchemaMap(new FrozenMap<>(properties)); @@ -250,11 +285,11 @@ public ObjectWithOutputTypeSchemaMap validate(Map arg, SchemaCon } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -275,7 +310,7 @@ public void testValidateObjectWithPropsSchema() { // map with only property works Map inMap = new LinkedHashMap<>(); inMap.put("someString", "abc"); - FrozenMap validatedValue = schema.validate(inMap, configuration); + FrozenMap<@Nullable Object> validatedValue = schema.validate(inMap, configuration); LinkedHashMap outMap = new LinkedHashMap<>(); outMap.put("someString", "abc"); Assert.assertEquals(validatedValue, outMap); @@ -337,7 +372,7 @@ public void testValidateObjectWithPropsAndAddpropsSchema() { // map with only property works Map inMap = new LinkedHashMap<>(); inMap.put("someString", "abc"); - FrozenMap validatedValue = schema.validate(inMap, configuration); + FrozenMap<@Nullable Object> validatedValue = schema.validate(inMap, configuration); LinkedHashMap outMap = new LinkedHashMap<>(); outMap.put("someString", "abc"); Assert.assertEquals(validatedValue, outMap); diff --git a/src/main/resources/java/src/test/java/packagename/schemas/ObjectTypeSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/ObjectTypeSchemaTest.hbs index 33106ba9406..70c093a4963 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/ObjectTypeSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/ObjectTypeSchemaTest.hbs @@ -1,5 +1,6 @@ package {{{packageName}}}.schemas; +import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; import org.junit.Test; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; @@ -23,7 +24,6 @@ import java.util.Map; import java.util.Objects; import java.util.Set; - public class ObjectTypeSchemaTest { static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); static final ValidationMetadata validationMetadata = new ValidationMetadata( @@ -33,8 +33,8 @@ public class ObjectTypeSchemaTest { new LinkedHashSet<>() ); - public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator> { - private static ObjectWithPropsSchema instance; + public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator> { + private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -53,22 +53,30 @@ public class ObjectTypeSchemaTest { } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new InvalidTypeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -79,16 +87,16 @@ public class ObjectTypeSchemaTest { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } public static class ObjectWithAddpropsSchema extends JsonSchema implements MapSchemaValidator> { - private static ObjectWithAddpropsSchema instance; + private static @Nullable ObjectWithAddpropsSchema instance = null; private ObjectWithAddpropsSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -107,13 +115,24 @@ public class ObjectTypeSchemaTest { public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new InvalidTypeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - String castValue = (String) propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, castValue); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(castValue instanceof String)) { + throw new InvalidTypeException("Invalid type for property value"); + } + properties.put(propertyName, (String) castValue); } return new FrozenMap<>(properties); } @@ -130,17 +149,17 @@ public class ObjectTypeSchemaTest { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { @SuppressWarnings("unchecked") FrozenMap castArg = (FrozenMap) arg; return getNewInstance(castArg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } - public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator> { - private static ObjectWithPropsAndAddpropsSchema instance; + public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator> { + private static @Nullable ObjectWithPropsAndAddpropsSchema instance = null; private ObjectWithPropsAndAddpropsSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -159,22 +178,30 @@ public class ObjectTypeSchemaTest { } @Override - public FrozenMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + public FrozenMap<@Nullable Object> getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new InvalidTypeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new FrozenMap<>(properties); } @Override - public FrozenMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -185,17 +212,17 @@ public class ObjectTypeSchemaTest { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { @SuppressWarnings("unchecked") FrozenMap castArg = (FrozenMap) arg; return getNewInstance(castArg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } - public static class ObjectWithOutputTypeSchemaMap extends FrozenMap { - protected ObjectWithOutputTypeSchemaMap(FrozenMap m) { + public static class ObjectWithOutputTypeSchemaMap extends FrozenMap<@Nullable Object> { + protected ObjectWithOutputTypeSchemaMap(FrozenMap<@Nullable Object> m) { super(m); } @@ -206,7 +233,7 @@ public class ObjectTypeSchemaTest { public static class ObjectWithOutputTypeSchema extends JsonSchema implements MapSchemaValidator { - private static ObjectWithOutputTypeSchema instance; + private static @Nullable ObjectWithOutputTypeSchema instance = null; public ObjectWithOutputTypeSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -225,14 +252,22 @@ public class ObjectTypeSchemaTest { @Override public ObjectWithOutputTypeSchemaMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); + LinkedHashMap properties = new LinkedHashMap<>(); for(Map.Entry entry: arg.entrySet()) { - String propertyName = (String) entry.getKey(); + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new InvalidTypeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - JsonSchema propertySchema = pathToSchemas.get(propertyPathToItem).entrySet().iterator().next().getKey(); - Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } return new ObjectWithOutputTypeSchemaMap(new FrozenMap<>(properties)); @@ -250,11 +285,11 @@ public class ObjectTypeSchemaTest { } @Override - public Object getNewInstance(Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { return getNewInstance((Map) arg, pathToItem, pathToSchemas); } - throw new InvalidTypeException("Invalid input type="+arg.getClass()+". It can't be instantiated by this schema"); + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } } @@ -275,7 +310,7 @@ public class ObjectTypeSchemaTest { // map with only property works Map inMap = new LinkedHashMap<>(); inMap.put("someString", "abc"); - FrozenMap validatedValue = schema.validate(inMap, configuration); + FrozenMap<@Nullable Object> validatedValue = schema.validate(inMap, configuration); LinkedHashMap outMap = new LinkedHashMap<>(); outMap.put("someString", "abc"); Assert.assertEquals(validatedValue, outMap); @@ -337,7 +372,7 @@ public class ObjectTypeSchemaTest { // map with only property works Map inMap = new LinkedHashMap<>(); inMap.put("someString", "abc"); - FrozenMap validatedValue = schema.validate(inMap, configuration); + FrozenMap<@Nullable Object> validatedValue = schema.validate(inMap, configuration); LinkedHashMap outMap = new LinkedHashMap<>(); outMap.put("someString", "abc"); Assert.assertEquals(validatedValue, outMap); From ceb9fa986ac3be62fdbcf99d6fe1b71ae84887ab Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 20 Dec 2023 16:13:26 -0800 Subject: [PATCH 52/52] Adds Nullable to input types --- ...pertiesAllowsASchemaWhichShouldValidate.md | 10 +- ...AdditionalpropertiesAreAllowedByDefault.md | 10 +- ...nalpropertiesShouldNotLookInApplicators.md | 8 +- .../java/docs/components/schemas/Allof.md | 12 +- .../components/schemas/AllofWithBaseSchema.md | 18 +- .../components/schemas/AnyofComplexTypes.md | 12 +- .../schemas/ArrayTypeMatchesArrays.md | 8 +- .../components/schemas/EnumsInProperties.md | 6 +- .../components/schemas/ForbiddenProperty.md | 8 +- .../schemas/InvalidStringValueForDefault.md | 6 +- .../schemas/NotMoreComplexSchema.md | 6 +- .../schemas/ObjectPropertiesValidation.md | 6 +- .../components/schemas/OneofComplexTypes.md | 12 +- .../components/schemas/OneofWithRequired.md | 20 +- .../PropertiesWithEscapedCharacters.md | 6 +- .../PropertyNamedRefThatIsNotAReference.md | 6 +- .../schemas/RefInAdditionalproperties.md | 8 +- .../docs/components/schemas/RefInItems.md | 8 +- .../docs/components/schemas/RefInProperty.md | 8 +- .../schemas/RequiredDefaultValidation.md | 8 +- .../components/schemas/RequiredValidation.md | 10 +- .../schemas/RequiredWithEmptyArray.md | 8 +- .../schemas/RequiredWithEscapedCharacters.md | 18 +- ...DoesNotDoAnythingIfThePropertyIsMissing.md | 6 +- ...rtiesAllowsASchemaWhichShouldValidate.java | 6 +- ...ditionalpropertiesAreAllowedByDefault.java | 6 +- ...lpropertiesShouldNotLookInApplicators.java | 8 +- .../client/components/schemas/Allof.java | 16 +- .../schemas/AllofCombinedWithAnyofOneof.java | 16 +- .../components/schemas/AllofSimpleTypes.java | 12 +- .../schemas/AllofWithBaseSchema.java | 18 +- .../schemas/AllofWithOneEmptySchema.java | 4 +- .../schemas/AllofWithTheFirstEmptySchema.java | 4 +- .../schemas/AllofWithTheLastEmptySchema.java | 4 +- .../schemas/AllofWithTwoEmptySchemas.java | 4 +- .../client/components/schemas/Anyof.java | 8 +- .../components/schemas/AnyofComplexTypes.java | 16 +- .../schemas/AnyofWithBaseSchema.java | 8 +- .../schemas/AnyofWithOneEmptySchema.java | 4 +- .../schemas/ArrayTypeMatchesArrays.java | 8 +- .../client/components/schemas/ByInt.java | 4 +- .../client/components/schemas/ByNumber.java | 4 +- .../components/schemas/BySmallNumber.java | 4 +- .../components/schemas/DateTimeFormat.java | 4 +- .../components/schemas/EmailFormat.java | 4 +- .../components/schemas/EnumsInProperties.java | 6 +- .../components/schemas/ForbiddenProperty.java | 6 +- .../components/schemas/HostnameFormat.java | 4 +- .../schemas/InvalidStringValueForDefault.java | 6 +- .../client/components/schemas/Ipv4Format.java | 4 +- .../client/components/schemas/Ipv6Format.java | 4 +- .../components/schemas/JsonPointerFormat.java | 4 +- .../components/schemas/MaximumValidation.java | 4 +- .../MaximumValidationWithUnsignedInteger.java | 4 +- .../schemas/MaxitemsValidation.java | 4 +- .../schemas/MaxlengthValidation.java | 4 +- .../Maxproperties0MeansTheObjectIsEmpty.java | 4 +- .../schemas/MaxpropertiesValidation.java | 4 +- .../components/schemas/MinimumValidation.java | 4 +- .../MinimumValidationWithSignedInteger.java | 4 +- .../schemas/MinitemsValidation.java | 4 +- .../schemas/MinlengthValidation.java | 4 +- .../schemas/MinpropertiesValidation.java | 4 +- ...NestedAllofToCheckValidationSemantics.java | 8 +- ...NestedAnyofToCheckValidationSemantics.java | 8 +- ...NestedOneofToCheckValidationSemantics.java | 8 +- .../client/components/schemas/Not.java | 4 +- .../schemas/NotMoreComplexSchema.java | 10 +- .../schemas/ObjectPropertiesValidation.java | 6 +- .../client/components/schemas/Oneof.java | 8 +- .../components/schemas/OneofComplexTypes.java | 16 +- .../schemas/OneofWithBaseSchema.java | 8 +- .../schemas/OneofWithEmptySchema.java | 4 +- .../components/schemas/OneofWithRequired.java | 16 +- .../schemas/PatternIsNotAnchored.java | 4 +- .../components/schemas/PatternValidation.java | 4 +- .../PropertiesWithEscapedCharacters.java | 6 +- .../PropertyNamedRefThatIsNotAReference.java | 6 +- .../schemas/RefInAdditionalproperties.java | 6 +- .../client/components/schemas/RefInAllof.java | 4 +- .../client/components/schemas/RefInAnyof.java | 4 +- .../client/components/schemas/RefInItems.java | 8 +- .../client/components/schemas/RefInNot.java | 4 +- .../client/components/schemas/RefInOneof.java | 4 +- .../components/schemas/RefInProperty.java | 6 +- .../schemas/RequiredDefaultValidation.java | 6 +- .../schemas/RequiredValidation.java | 6 +- .../schemas/RequiredWithEmptyArray.java | 6 +- .../RequiredWithEscapedCharacters.java | 6 +- ...esNotDoAnythingIfThePropertyIsMissing.java | 6 +- .../schemas/UniqueitemsFalseValidation.java | 4 +- .../schemas/UniqueitemsValidation.java | 4 +- .../client/components/schemas/UriFormat.java | 4 +- .../schemas/UriReferenceFormat.java | 4 +- .../components/schemas/UriTemplateFormat.java | 4 +- .../_Schema_anytypeOrMultitype.hbs | 4 +- .../schemas/SchemaClass/_Schema_map.hbs | 2 +- .../schemas/types/_schema_cast_type_base.hbs | 206 ------------------ .../schemas/types/_schema_input_type_base.hbs | 44 ++-- .../schemas/types/schema_cast_type.hbs | 13 -- 100 files changed, 362 insertions(+), 577 deletions(-) delete mode 100644 src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_cast_type_base.hbs delete mode 100644 src/main/resources/java/src/main/java/packagename/components/schemas/types/schema_cast_type.hbs diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md index 31e37f08468..f8d8493dc3b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md @@ -59,19 +59,19 @@ AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsA ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) | validate([Map](#additionalpropertiesallowsaschemawhichshouldvalidatemapinput) arg, SchemaConfiguration configuration) | +| static [AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) | validate([Map](#additionalpropertiesallowsaschemawhichshouldvalidatemapinput) arg, SchemaConfiguration configuration) | ## AdditionalpropertiesAllowsASchemaWhichShouldValidateMapInput public class AdditionalpropertiesAllowsASchemaWhichShouldValidateMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **foo** | Object | | [optional] | -| **bar** | Object | | [optional] | +| **foo** | @Nullable Object | | [optional] | +| **bar** | @Nullable Object | | [optional] | | **anyStringName** | boolean | any string name can be used but the value must be the correct type | [optional] | ## AdditionalpropertiesAllowsASchemaWhichShouldValidateMap @@ -83,7 +83,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) | of([Map](#additionalpropertiesallowsaschemawhichshouldvalidatemapinput) arg, SchemaConfiguration configuration) | +| static [AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) | of([Map](#additionalpropertiesallowsaschemawhichshouldvalidatemapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | foo()
[optional] | | @Nullable Object | bar()
[optional] | | boolean | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md index 724177f700e..445e3d72a1c 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md @@ -39,20 +39,20 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) | validate([Map](#additionalpropertiesareallowedbydefaultmapinput) arg, SchemaConfiguration configuration) | +| static [AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) | validate([Map](#additionalpropertiesareallowedbydefaultmapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## AdditionalpropertiesAreAllowedByDefaultMapInput public class AdditionalpropertiesAreAllowedByDefaultMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **foo** | Object | | [optional] | -| **bar** | Object | | [optional] | +| **foo** | @Nullable Object | | [optional] | +| **bar** | @Nullable Object | | [optional] | | **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | ## AdditionalpropertiesAreAllowedByDefaultMap @@ -64,7 +64,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) | of([Map](#additionalpropertiesareallowedbydefaultmapinput) arg, SchemaConfiguration configuration) | +| static [AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) | of([Map](#additionalpropertiesareallowedbydefaultmapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | foo()
[optional] | | @Nullable Object | bar()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md index 528fe0a028b..6230a58936e 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md @@ -90,19 +90,19 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema0MapInput public class Schema0MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **foo** | Object | | [optional] | +| **foo** | @Nullable Object | | [optional] | | **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | ## Schema0Map @@ -114,7 +114,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md index 7791aefeacf..0131c2ac187 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md @@ -68,12 +68,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema1Map](#schema1map) | validate([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | +| static [Schema1Map](#schema1map) | validate([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema1MapInput public class Schema1MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -92,7 +92,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | +| static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | | String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | @@ -128,12 +128,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema0MapInput public class Schema0MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -152,7 +152,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | long | bar()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md index 295dcfb4ef7..846e1926309 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md @@ -48,12 +48,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [AllofWithBaseSchemaMap](#allofwithbaseschemamap) | validate([Map](#allofwithbaseschemamapinput) arg, SchemaConfiguration configuration) | +| static [AllofWithBaseSchemaMap](#allofwithbaseschemamap) | validate([Map](#allofwithbaseschemamapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## AllofWithBaseSchemaMapInput public class AllofWithBaseSchemaMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -72,7 +72,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [AllofWithBaseSchemaMap](#allofwithbaseschemamap) | of([Map](#allofwithbaseschemamapinput) arg, SchemaConfiguration configuration) | +| static [AllofWithBaseSchemaMap](#allofwithbaseschemamap) | of([Map](#allofwithbaseschemamapinput) arg, SchemaConfiguration configuration) | | long | bar()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | @@ -108,12 +108,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema1Map](#schema1map) | validate([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | +| static [Schema1Map](#schema1map) | validate([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema1MapInput public class Schema1MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -132,7 +132,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | +| static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | | Void | baz()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | @@ -168,12 +168,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema0MapInput public class Schema0MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -192,7 +192,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md index 21921a7eb2c..755eebe7647 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md @@ -68,12 +68,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema1Map](#schema1map) | validate([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | +| static [Schema1Map](#schema1map) | validate([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema1MapInput public class Schema1MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -92,7 +92,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | +| static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | | String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | @@ -128,12 +128,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema0MapInput public class Schema0MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -152,7 +152,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | long | bar()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md index 6056a072f56..fd2323f5204 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md @@ -56,18 +56,18 @@ ArrayTypeMatchesArrays.ArrayTypeMatchesArraysList validatedPayload = ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [ArrayTypeMatchesArraysList](#arraytypematchesarrayslist) | validate([List](#arraytypematchesarrayslistinput) arg, SchemaConfiguration configuration) | +| static [ArrayTypeMatchesArraysList](#arraytypematchesarrayslist) | validate([List<@Nullable Object>](#arraytypematchesarrayslistinput) arg, SchemaConfiguration configuration) | ## ArrayTypeMatchesArraysListInput public class ArrayTypeMatchesArraysListInput
-builder for `List` +builder for `List<@Nullable Object>` A class that builds the List input type ## Input List Items List Item Type | Description | Notes -------------------- | ------------- | ------------- -Object | | +@Nullable Object | | ## ArrayTypeMatchesArraysList public class ArrayTypeMatchesArraysList
@@ -78,7 +78,7 @@ A class to store validated List payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [ArrayTypeMatchesArraysList](#arraytypematchesarrayslist) | of([List](#arraytypematchesarrayslistinput) arg, SchemaConfiguration configuration) | +| static [ArrayTypeMatchesArraysList](#arraytypematchesarrayslist) | of([List<@Nullable Object>](#arraytypematchesarrayslistinput) arg, SchemaConfiguration configuration) | ## Items public static class Items
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md index 88d4b1d505b..e76a01bdb13 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md @@ -66,11 +66,11 @@ EnumsInProperties.EnumsInPropertiesMap validatedPayload = ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [EnumsInPropertiesMap](#enumsinpropertiesmap) | validate([Map](#enumsinpropertiesmapinput) arg, SchemaConfiguration configuration) | +| static [EnumsInPropertiesMap](#enumsinpropertiesmap) | validate([Map](#enumsinpropertiesmapinput) arg, SchemaConfiguration configuration) | ## EnumsInPropertiesMapInput public class EnumsInPropertiesMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -90,7 +90,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [EnumsInPropertiesMap](#enumsinpropertiesmap) | of([Map](#enumsinpropertiesmapinput) arg, SchemaConfiguration configuration) | +| static [EnumsInPropertiesMap](#enumsinpropertiesmap) | of([Map](#enumsinpropertiesmapinput) arg, SchemaConfiguration configuration) | | String | bar()
must be one of ["bar"] | | String | foo()
[optional] must be one of ["foo"] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md index cdb9490f13e..3a91701112d 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md @@ -38,19 +38,19 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [ForbiddenPropertyMap](#forbiddenpropertymap) | validate([Map](#forbiddenpropertymapinput) arg, SchemaConfiguration configuration) | +| static [ForbiddenPropertyMap](#forbiddenpropertymap) | validate([Map](#forbiddenpropertymapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## ForbiddenPropertyMapInput public class ForbiddenPropertyMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **foo** | Object | | [optional] | +| **foo** | @Nullable Object | | [optional] | | **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | ## ForbiddenPropertyMap @@ -62,7 +62,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [ForbiddenPropertyMap](#forbiddenpropertymap) | of([Map](#forbiddenpropertymapinput) arg, SchemaConfiguration configuration) | +| static [ForbiddenPropertyMap](#forbiddenpropertymap) | of([Map](#forbiddenpropertymapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md index bbb7e03d06b..35d5f79b0be 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md @@ -38,12 +38,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [InvalidStringValueForDefaultMap](#invalidstringvaluefordefaultmap) | validate([Map](#invalidstringvaluefordefaultmapinput) arg, SchemaConfiguration configuration) | +| static [InvalidStringValueForDefaultMap](#invalidstringvaluefordefaultmap) | validate([Map](#invalidstringvaluefordefaultmapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## InvalidStringValueForDefaultMapInput public class InvalidStringValueForDefaultMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -62,7 +62,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [InvalidStringValueForDefaultMap](#invalidstringvaluefordefaultmap) | of([Map](#invalidstringvaluefordefaultmapinput) arg, SchemaConfiguration configuration) | +| static [InvalidStringValueForDefaultMap](#invalidstringvaluefordefaultmap) | of([Map](#invalidstringvaluefordefaultmapinput) arg, SchemaConfiguration configuration) | | String | bar()
[optional] if omitted the server will use the default value of bad | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md index 8d7270325bb..6daf781dfb2 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md @@ -85,11 +85,11 @@ NotMoreComplexSchema.NotMap validatedPayload = ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [NotMap](#notmap) | validate([Map](#notmapinput) arg, SchemaConfiguration configuration) | +| static [NotMap](#notmap) | validate([Map](#notmapinput) arg, SchemaConfiguration configuration) | ## NotMapInput public class NotMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -108,7 +108,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [NotMap](#notmap) | of([Map](#notmapinput) arg, SchemaConfiguration configuration) | +| static [NotMap](#notmap) | of([Map](#notmapinput) arg, SchemaConfiguration configuration) | | String | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md index 0dfbac98c39..289def46da2 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md @@ -39,12 +39,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) | validate([Map](#objectpropertiesvalidationmapinput) arg, SchemaConfiguration configuration) | +| static [ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) | validate([Map](#objectpropertiesvalidationmapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## ObjectPropertiesValidationMapInput public class ObjectPropertiesValidationMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -64,7 +64,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) | of([Map](#objectpropertiesvalidationmapinput) arg, SchemaConfiguration configuration) | +| static [ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) | of([Map](#objectpropertiesvalidationmapinput) arg, SchemaConfiguration configuration) | | long | foo()
[optional] | | String | bar()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md index 39f86c18df2..dc5c1ec536d 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md @@ -68,12 +68,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema1Map](#schema1map) | validate([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | +| static [Schema1Map](#schema1map) | validate([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema1MapInput public class Schema1MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -92,7 +92,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | +| static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | | String | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | @@ -128,12 +128,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema0MapInput public class Schema0MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -152,7 +152,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | long | bar()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md index 3572671d136..ccc4df8ef33 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md @@ -58,20 +58,20 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema1Map](#schema1map) | validate([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | +| static [Schema1Map](#schema1map) | validate([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema1MapInput public class Schema1MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **baz** | Object | | | -| **foo** | Object | | | +| **baz** | @Nullable Object | | | +| **foo** | @Nullable Object | | | | **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | ## Schema1Map @@ -83,7 +83,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | +| static [Schema1Map](#schema1map) | of([Map](#schema1mapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | baz()
| | @Nullable Object | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | @@ -109,20 +109,20 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | validate([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## Schema0MapInput public class Schema0MapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **bar** | Object | | | -| **foo** | Object | | | +| **bar** | @Nullable Object | | | +| **foo** | @Nullable Object | | | | **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | ## Schema0Map @@ -134,7 +134,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | +| static [Schema0Map](#schema0map) | of([Map](#schema0mapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | bar()
| | @Nullable Object | foo()
| | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md index e087f56ce20..b022ff1fa96 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md @@ -43,12 +43,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) | validate([Map](#propertieswithescapedcharactersmapinput) arg, SchemaConfiguration configuration) | +| static [PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) | validate([Map](#propertieswithescapedcharactersmapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## PropertiesWithEscapedCharactersMapInput public class PropertiesWithEscapedCharactersMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -72,7 +72,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) | of([Map](#propertieswithescapedcharactersmapinput) arg, SchemaConfiguration configuration) | +| static [PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) | of([Map](#propertieswithescapedcharactersmapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["foo\nbar"], instance["foo\"bar"], instance["foo\\bar"], instance["foo\rbar"], instance["foo\tbar"], instance["foo\fbar"], | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md index 0cecdca134b..25046539ee5 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md @@ -38,12 +38,12 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) | validate([Map](#propertynamedrefthatisnotareferencemapinput) arg, SchemaConfiguration configuration) | +| static [PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) | validate([Map](#propertynamedrefthatisnotareferencemapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## PropertyNamedRefThatIsNotAReferenceMapInput public class PropertyNamedRefThatIsNotAReferenceMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -62,7 +62,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) | of([Map](#propertynamedrefthatisnotareferencemapinput) arg, SchemaConfiguration configuration) | +| static [PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) | of([Map](#propertynamedrefthatisnotareferencemapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["$ref"], | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md index fc222d7ebfa..1c4b0692c21 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md @@ -55,18 +55,18 @@ RefInAdditionalproperties.RefInAdditionalpropertiesMap validatedPayload = ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [RefInAdditionalpropertiesMap](#refinadditionalpropertiesmap) | validate([Map](#refinadditionalpropertiesmapinput) arg, SchemaConfiguration configuration) | +| static [RefInAdditionalpropertiesMap](#refinadditionalpropertiesmap) | validate([Map](#refinadditionalpropertiesmapinput) arg, SchemaConfiguration configuration) | ## RefInAdditionalpropertiesMapInput public class RefInAdditionalpropertiesMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | +| **anyStringName** | @Nullable Object | any string name can be used but the value must be the correct type | [optional] | ## RefInAdditionalpropertiesMap public static class RefInAdditionalpropertiesMap
@@ -77,7 +77,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [RefInAdditionalpropertiesMap](#refinadditionalpropertiesmap) | of([Map](#refinadditionalpropertiesmapinput) arg, SchemaConfiguration configuration) | +| static [RefInAdditionalpropertiesMap](#refinadditionalpropertiesmap) | of([Map](#refinadditionalpropertiesmapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md index 42021e1e4c2..2b61c9b9a0a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md @@ -55,18 +55,18 @@ RefInItems.RefInItemsList validatedPayload = ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [RefInItemsList](#refinitemslist) | validate([List](#refinitemslistinput) arg, SchemaConfiguration configuration) | +| static [RefInItemsList](#refinitemslist) | validate([List<@Nullable Object>](#refinitemslistinput) arg, SchemaConfiguration configuration) | ## RefInItemsListInput public class RefInItemsListInput
-builder for `List` +builder for `List<@Nullable Object>` A class that builds the List input type ## Input List Items List Item Type | Description | Notes -------------------- | ------------- | ------------- -Object | | +@Nullable Object | | ## RefInItemsList public class RefInItemsList
@@ -77,6 +77,6 @@ A class to store validated List payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [RefInItemsList](#refinitemslist) | of([List](#refinitemslistinput) arg, SchemaConfiguration configuration) | +| static [RefInItemsList](#refinitemslist) | of([List<@Nullable Object>](#refinitemslistinput) arg, SchemaConfiguration configuration) | [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md index 71a7b907614..ce4bff04641 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md @@ -37,19 +37,19 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [RefInPropertyMap](#refinpropertymap) | validate([Map](#refinpropertymapinput) arg, SchemaConfiguration configuration) | +| static [RefInPropertyMap](#refinpropertymap) | validate([Map](#refinpropertymapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## RefInPropertyMapInput public class RefInPropertyMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **a** | Object | | [optional] | +| **a** | @Nullable Object | | [optional] | | **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | ## RefInPropertyMap @@ -61,7 +61,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [RefInPropertyMap](#refinpropertymap) | of([Map](#refinpropertymapinput) arg, SchemaConfiguration configuration) | +| static [RefInPropertyMap](#refinpropertymap) | of([Map](#refinpropertymapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | a()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md index 4ed8beeff15..1b30185fa24 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md @@ -38,19 +38,19 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [RequiredDefaultValidationMap](#requireddefaultvalidationmap) | validate([Map](#requireddefaultvalidationmapinput) arg, SchemaConfiguration configuration) | +| static [RequiredDefaultValidationMap](#requireddefaultvalidationmap) | validate([Map](#requireddefaultvalidationmapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## RequiredDefaultValidationMapInput public class RequiredDefaultValidationMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **foo** | Object | | [optional] | +| **foo** | @Nullable Object | | [optional] | | **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | ## RequiredDefaultValidationMap @@ -62,7 +62,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [RequiredDefaultValidationMap](#requireddefaultvalidationmap) | of([Map](#requireddefaultvalidationmapinput) arg, SchemaConfiguration configuration) | +| static [RequiredDefaultValidationMap](#requireddefaultvalidationmap) | of([Map](#requireddefaultvalidationmapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md index 15cd09c5fcd..dd7ec4b532a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md @@ -40,20 +40,20 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [RequiredValidationMap](#requiredvalidationmap) | validate([Map](#requiredvalidationmapinput) arg, SchemaConfiguration configuration) | +| static [RequiredValidationMap](#requiredvalidationmap) | validate([Map](#requiredvalidationmapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## RequiredValidationMapInput public class RequiredValidationMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **foo** | Object | | | -| **bar** | Object | | [optional] | +| **foo** | @Nullable Object | | | +| **bar** | @Nullable Object | | [optional] | | **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | ## RequiredValidationMap @@ -65,7 +65,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [RequiredValidationMap](#requiredvalidationmap) | of([Map](#requiredvalidationmapinput) arg, SchemaConfiguration configuration) | +| static [RequiredValidationMap](#requiredvalidationmap) | of([Map](#requiredvalidationmapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | foo()
| | @Nullable Object | bar()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md index cccf3dd920c..15ef13cce71 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md @@ -38,19 +38,19 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) | validate([Map](#requiredwithemptyarraymapinput) arg, SchemaConfiguration configuration) | +| static [RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) | validate([Map](#requiredwithemptyarraymapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## RequiredWithEmptyArrayMapInput public class RequiredWithEmptyArrayMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **foo** | Object | | [optional] | +| **foo** | @Nullable Object | | [optional] | | **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | ## RequiredWithEmptyArrayMap @@ -62,7 +62,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) | of([Map](#requiredwithemptyarraymapinput) arg, SchemaConfiguration configuration) | +| static [RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) | of([Map](#requiredwithemptyarraymapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | foo()
[optional] | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md index c0d0a0c64e2..5183d13e257 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md @@ -37,24 +37,24 @@ A schema class that validates payloads | static float | validate(float arg, SchemaConfiguration configuration) | | static double | validate(double arg, SchemaConfiguration configuration) | | static boolean | validate(boolean arg, SchemaConfiguration configuration) | -| static [RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) | validate([Map](#requiredwithescapedcharactersmapinput) arg, SchemaConfiguration configuration) | +| static [RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) | validate([Map](#requiredwithescapedcharactersmapinput) arg, SchemaConfiguration configuration) | | FrozenList | validate(List arg, SchemaConfiguration configuration) | ## RequiredWithEscapedCharactersMapInput public class RequiredWithEscapedCharactersMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type ## Input Map Keys | Key | Type | Description | Notes | | --- | ---- | ------------ | ----- | -| **foo\tbar** | Object | | | -| **foo\nbar** | Object | | | -| **foo\fbar** | Object | | | -| **foo\rbar** | Object | | | -| **foo\"bar** | Object | | | -| **foo\\bar** | Object | | | +| **foo\tbar** | @Nullable Object | | | +| **foo\nbar** | @Nullable Object | | | +| **foo\fbar** | @Nullable Object | | | +| **foo\rbar** | @Nullable Object | | | +| **foo\"bar** | @Nullable Object | | | +| **foo\\bar** | @Nullable Object | | | | **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] | ## RequiredWithEscapedCharactersMap @@ -66,7 +66,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) | of([Map](#requiredwithescapedcharactersmapinput) arg, SchemaConfiguration configuration) | +| static [RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) | of([Map](#requiredwithescapedcharactersmapinput) arg, SchemaConfiguration configuration) | | @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["foo\tbar"], instance["foo\nbar"], instance["foo\fbar"], instance["foo\rbar"], instance["foo\"bar"], instance["foo\\bar"], | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md index 973eaace1dc..9bf122f0920 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md @@ -60,11 +60,11 @@ TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNo ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) | validate([Map](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmapinput) arg, SchemaConfiguration configuration) | +| static [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) | validate([Map](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmapinput) arg, SchemaConfiguration configuration) | ## TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMapInput public class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMapInput
-builder for `Map` +builder for `Map` A class that builds the Map input type @@ -83,7 +83,7 @@ A class to store validated Map payloads ### Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| static [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) | of([Map](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmapinput) arg, SchemaConfiguration configuration) | +| static [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) | of([Map](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmapinput) arg, SchemaConfiguration configuration) | | Number | alpha()
[optional] if omitted the server will use the default value of 5.0 | | Object | getAdditionalProperty(String name)
provides type safety for additional properties | diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index 490701281d7..62403005d7a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -47,7 +47,7 @@ protected AdditionalpropertiesAllowsASchemaWhichShouldValidateMap(FrozenMap<@Nul "foo", "bar" ); - public static AdditionalpropertiesAllowsASchemaWhichShouldValidateMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static AdditionalpropertiesAllowsASchemaWhichShouldValidateMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return AdditionalpropertiesAllowsASchemaWhichShouldValidate1.getInstance().validate(arg, configuration); } @@ -78,7 +78,7 @@ public static class AdditionalpropertiesAllowsASchemaWhichShouldValidateMapInput } - public static class AdditionalpropertiesAllowsASchemaWhichShouldValidate1 extends JsonSchema implements MapSchemaValidator { + public static class AdditionalpropertiesAllowsASchemaWhichShouldValidate1 extends JsonSchema implements MapSchemaValidator<@Nullable Object, AdditionalpropertiesAllowsASchemaWhichShouldValidateMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -132,7 +132,7 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap getNewInstance(Ma } @Override - public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index 345dbaaf58e..3f035ee63d4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -52,7 +52,7 @@ protected AdditionalpropertiesAreAllowedByDefaultMap(FrozenMap<@Nullable Object> "foo", "bar" ); - public static AdditionalpropertiesAreAllowedByDefaultMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static AdditionalpropertiesAreAllowedByDefaultMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return AdditionalpropertiesAreAllowedByDefault1.getInstance().validate(arg, configuration); } @@ -79,7 +79,7 @@ public static class AdditionalpropertiesAreAllowedByDefaultMapInput { } - public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, AdditionalpropertiesAreAllowedByDefaultMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -246,7 +246,7 @@ public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, } @Override - public AdditionalpropertiesAreAllowedByDefaultMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public AdditionalpropertiesAreAllowedByDefaultMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index 2ab3599b0e1..67323fb3f4a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -52,7 +52,7 @@ protected Schema0Map(FrozenMap<@Nullable Object> m) { public static final Set optionalKeys = Set.of( "foo" ); - public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema0.getInstance().validate(arg, configuration); } @@ -73,7 +73,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema0Map> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -233,7 +233,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -289,7 +289,7 @@ public static class AdditionalpropertiesShouldNotLookInApplicatorsMapInput { } - public static class AdditionalpropertiesShouldNotLookInApplicators1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class AdditionalpropertiesShouldNotLookInApplicators1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index 41d2b5ebde2..6e06afc76e9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -49,7 +49,7 @@ protected Schema0Map(FrozenMap<@Nullable Object> m) { "bar" ); public static final Set optionalKeys = Set.of(); - public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema0.getInstance().validate(arg, configuration); } @@ -72,7 +72,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema0Map> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -235,7 +235,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -278,7 +278,7 @@ protected Schema1Map(FrozenMap<@Nullable Object> m) { "foo" ); public static final Set optionalKeys = Set.of(); - public static Schema1Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema1Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema1.getInstance().validate(arg, configuration); } @@ -301,7 +301,7 @@ public static class Schema1MapInput { } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema1Map> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -464,7 +464,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema1Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema1Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -496,7 +496,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class Allof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Allof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -663,7 +663,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index f1a221843ae..46ed4f198fd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -36,7 +36,7 @@ public class AllofCombinedWithAnyofOneof { // nest classes so all schemas and input/output classes can be public - public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema02 instance = null; protected Schema02() { @@ -194,7 +194,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -226,7 +226,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -384,7 +384,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -416,7 +416,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -574,7 +574,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -606,7 +606,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -778,7 +778,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index 6aefa9f4617..50a13e47085 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -35,7 +35,7 @@ public class AllofSimpleTypes { // nest classes so all schemas and input/output classes can be public - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -193,7 +193,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -225,7 +225,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -383,7 +383,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -415,7 +415,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -582,7 +582,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index 11c969636a8..237c0b36ce7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -50,7 +50,7 @@ protected Schema0Map(FrozenMap<@Nullable Object> m) { "foo" ); public static final Set optionalKeys = Set.of(); - public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema0.getInstance().validate(arg, configuration); } @@ -73,7 +73,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema0Map> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -236,7 +236,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -279,7 +279,7 @@ protected Schema1Map(FrozenMap<@Nullable Object> m) { "baz" ); public static final Set optionalKeys = Set.of(); - public static Schema1Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema1Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema1.getInstance().validate(arg, configuration); } @@ -302,7 +302,7 @@ public static class Schema1MapInput { } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema1Map> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -465,7 +465,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema1Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema1Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -508,7 +508,7 @@ protected AllofWithBaseSchemaMap(FrozenMap<@Nullable Object> m) { "bar" ); public static final Set optionalKeys = Set.of(); - public static AllofWithBaseSchemaMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static AllofWithBaseSchemaMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return AllofWithBaseSchema1.getInstance().validate(arg, configuration); } @@ -531,7 +531,7 @@ public static class AllofWithBaseSchemaMapInput { } - public static class AllofWithBaseSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class AllofWithBaseSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, AllofWithBaseSchemaMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -704,7 +704,7 @@ public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToI } @Override - public AllofWithBaseSchemaMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public AllofWithBaseSchemaMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index 7d33c488a16..be54677f54b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -39,7 +39,7 @@ public class AllofWithOneEmptySchema { public static class Schema0 extends AnyTypeJsonSchema {} - public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -205,7 +205,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 18c8d9d6bb1..56dc6a12c35 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -43,7 +43,7 @@ public static class Schema0 extends AnyTypeJsonSchema {} public static class Schema1 extends NumberJsonSchema {} - public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -210,7 +210,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 3f75c40259e..a22de51a891 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -43,7 +43,7 @@ public static class Schema0 extends NumberJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -210,7 +210,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index 57ba4713f5e..6a0ad0d813c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -42,7 +42,7 @@ public static class Schema0 extends AnyTypeJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -209,7 +209,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index c848f94ac4a..2cb38b9cfc5 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -39,7 +39,7 @@ public class Anyof { public static class Schema0 extends IntJsonSchema {} - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -197,7 +197,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -229,7 +229,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class Anyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Anyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -396,7 +396,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index e45d5c197d6..8cc875ec166 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -49,7 +49,7 @@ protected Schema0Map(FrozenMap<@Nullable Object> m) { "bar" ); public static final Set optionalKeys = Set.of(); - public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema0.getInstance().validate(arg, configuration); } @@ -72,7 +72,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema0Map> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -235,7 +235,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -278,7 +278,7 @@ protected Schema1Map(FrozenMap<@Nullable Object> m) { "foo" ); public static final Set optionalKeys = Set.of(); - public static Schema1Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema1Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema1.getInstance().validate(arg, configuration); } @@ -301,7 +301,7 @@ public static class Schema1MapInput { } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema1Map> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -464,7 +464,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema1Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema1Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -496,7 +496,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -663,7 +663,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index bfb32680729..55e4c4a43b4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -35,7 +35,7 @@ public class AnyofWithBaseSchema { // nest classes so all schemas and input/output classes can be public - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -193,7 +193,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -225,7 +225,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -383,7 +383,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index d3edd997d64..61a3149cb84 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -43,7 +43,7 @@ public static class Schema0 extends NumberJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -210,7 +210,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java index e86b1436d8c..62c7262651c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java @@ -32,17 +32,17 @@ public static class ArrayTypeMatchesArraysList extends FrozenList<@Nullable Obje protected ArrayTypeMatchesArraysList(FrozenList<@Nullable Object> m) { super(m); } - public static ArrayTypeMatchesArraysList of(List arg, SchemaConfiguration configuration) throws ValidationException { + public static ArrayTypeMatchesArraysList of(List<@Nullable Object> arg, SchemaConfiguration configuration) throws ValidationException { return ArrayTypeMatchesArrays1.getInstance().validate(arg, configuration); } } public static class ArrayTypeMatchesArraysListInput { - // class to build List + // class to build List<@Nullable Object> } - public static class ArrayTypeMatchesArrays1 extends JsonSchema implements ListSchemaValidator { + public static class ArrayTypeMatchesArrays1 extends JsonSchema implements ListSchemaValidator<@Nullable Object, ArrayTypeMatchesArraysList> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -89,7 +89,7 @@ public ArrayTypeMatchesArraysList getNewInstance(List arg, List pathT } @Override - public ArrayTypeMatchesArraysList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public ArrayTypeMatchesArraysList validate(List<@Nullable Object> arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index d366846c4da..9f57779cb16 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -36,7 +36,7 @@ public class ByInt { // nest classes so all schemas and input/output classes can be public - public static class ByInt1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class ByInt1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -200,7 +200,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 3cae6f23cf0..4c5201e0ed1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -36,7 +36,7 @@ public class ByNumber { // nest classes so all schemas and input/output classes can be public - public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -200,7 +200,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index dcefc85a6ee..0263d3eeb92 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -36,7 +36,7 @@ public class BySmallNumber { // nest classes so all schemas and input/output classes can be public - public static class BySmallNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class BySmallNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -200,7 +200,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 52bb351656b..ca71bc66a27 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -35,7 +35,7 @@ public class DateTimeFormat { // nest classes so all schemas and input/output classes can be public - public static class DateTimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class DateTimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index fbe351e557e..2c6c233fd1e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -35,7 +35,7 @@ public class EmailFormat { // nest classes so all schemas and input/output classes can be public - public static class EmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class EmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index c551e3df7c9..709caa19f55 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -121,7 +121,7 @@ protected EnumsInPropertiesMap(FrozenMap<@Nullable Object> m) { public static final Set optionalKeys = Set.of( "foo" ); - public static EnumsInPropertiesMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static EnumsInPropertiesMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return EnumsInProperties1.getInstance().validate(arg, configuration); } @@ -154,7 +154,7 @@ public static class EnumsInPropertiesMapInput { } - public static class EnumsInProperties1 extends JsonSchema implements MapSchemaValidator { + public static class EnumsInProperties1 extends JsonSchema implements MapSchemaValidator<@Nullable Object, EnumsInPropertiesMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -210,7 +210,7 @@ public EnumsInPropertiesMap getNewInstance(Map arg, List pathToIte } @Override - public EnumsInPropertiesMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public EnumsInPropertiesMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index d03e98e5511..57aecaf436f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -50,7 +50,7 @@ protected ForbiddenPropertyMap(FrozenMap<@Nullable Object> m) { public static final Set optionalKeys = Set.of( "foo" ); - public static ForbiddenPropertyMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static ForbiddenPropertyMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return ForbiddenProperty1.getInstance().validate(arg, configuration); } @@ -71,7 +71,7 @@ public static class ForbiddenPropertyMapInput { } - public static class ForbiddenProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class ForbiddenProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, ForbiddenPropertyMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -237,7 +237,7 @@ public ForbiddenPropertyMap getNewInstance(Map arg, List pathToIte } @Override - public ForbiddenPropertyMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public ForbiddenPropertyMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 83c6bf9f883..6f06667e3e9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -35,7 +35,7 @@ public class HostnameFormat { // nest classes so all schemas and input/output classes can be public - public static class HostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class HostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index d52f73be698..9c23584e447 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -83,7 +83,7 @@ protected InvalidStringValueForDefaultMap(FrozenMap<@Nullable Object> m) { public static final Set optionalKeys = Set.of( "bar" ); - public static InvalidStringValueForDefaultMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static InvalidStringValueForDefaultMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return InvalidStringValueForDefault1.getInstance().validate(arg, configuration); } @@ -108,7 +108,7 @@ public static class InvalidStringValueForDefaultMapInput { } - public static class InvalidStringValueForDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class InvalidStringValueForDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, InvalidStringValueForDefaultMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -274,7 +274,7 @@ public InvalidStringValueForDefaultMap getNewInstance(Map arg, List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public InvalidStringValueForDefaultMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index 2ad039e9262..1b301ab802b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -35,7 +35,7 @@ public class Ipv4Format { // nest classes so all schemas and input/output classes can be public - public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index a4181167bc7..3026ad5b009 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -35,7 +35,7 @@ public class Ipv6Format { // nest classes so all schemas and input/output classes can be public - public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 03a29e0b744..d2e2e4214f1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -35,7 +35,7 @@ public class JsonPointerFormat { // nest classes so all schemas and input/output classes can be public - public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 2d5f77c739f..9dda17d0640 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -35,7 +35,7 @@ public class MaximumValidation { // nest classes so all schemas and input/output classes can be public - public static class MaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index c18c5df7baa..17639327670 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -35,7 +35,7 @@ public class MaximumValidationWithUnsignedInteger { // nest classes so all schemas and input/output classes can be public - public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index 93656943054..0634fc92865 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -35,7 +35,7 @@ public class MaxitemsValidation { // nest classes so all schemas and input/output classes can be public - public static class MaxitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaxitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index b71bdfdc758..3b7c27dc500 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -35,7 +35,7 @@ public class MaxlengthValidation { // nest classes so all schemas and input/output classes can be public - public static class MaxlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaxlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index 08df21c2b03..4ec6d0b5225 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -35,7 +35,7 @@ public class Maxproperties0MeansTheObjectIsEmpty { // nest classes so all schemas and input/output classes can be public - public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index cdbb2d8356f..ff98b6cb035 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -35,7 +35,7 @@ public class MaxpropertiesValidation { // nest classes so all schemas and input/output classes can be public - public static class MaxpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MaxpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index 31035e31bbd..4edeb94f9c1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -35,7 +35,7 @@ public class MinimumValidation { // nest classes so all schemas and input/output classes can be public - public static class MinimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index 8a7b707b32b..f0ae73bcbb1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -35,7 +35,7 @@ public class MinimumValidationWithSignedInteger { // nest classes so all schemas and input/output classes can be public - public static class MinimumValidationWithSignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinimumValidationWithSignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index 59cb8abe6aa..fe4ea46765f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -35,7 +35,7 @@ public class MinitemsValidation { // nest classes so all schemas and input/output classes can be public - public static class MinitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index fa134e136cd..53675489452 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -35,7 +35,7 @@ public class MinlengthValidation { // nest classes so all schemas and input/output classes can be public - public static class MinlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index 56c0417b485..6bd419fdae6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -35,7 +35,7 @@ public class MinpropertiesValidation { // nest classes so all schemas and input/output classes can be public - public static class MinpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class MinpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 0f0df27b565..7233175e9fb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -39,7 +39,7 @@ public class NestedAllofToCheckValidationSemantics { public static class Schema01 extends NullJsonSchema {} - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -231,7 +231,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -397,7 +397,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index d1c0e561877..36e2a49bbaa 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -39,7 +39,7 @@ public class NestedAnyofToCheckValidationSemantics { public static class Schema01 extends NullJsonSchema {} - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -231,7 +231,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -397,7 +397,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index fc3f4b88fd0..f2b3236b967 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -39,7 +39,7 @@ public class NestedOneofToCheckValidationSemantics { public static class Schema01 extends NullJsonSchema {} - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -231,7 +231,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -397,7 +397,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index 734b40a9862..1dd677f5591 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -39,7 +39,7 @@ public class Not { public static class Not2 extends IntJsonSchema {} - public static class Not1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Not1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -203,7 +203,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 0b92381c8f6..d0ce9f64db7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -48,7 +48,7 @@ protected NotMap(FrozenMap<@Nullable Object> m) { public static final Set optionalKeys = Set.of( "foo" ); - public static NotMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static NotMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Not.getInstance().validate(arg, configuration); } @@ -73,7 +73,7 @@ public static class NotMapInput { } - public static class Not extends JsonSchema implements MapSchemaValidator { + public static class Not extends JsonSchema implements MapSchemaValidator<@Nullable Object, NotMap> { private static @Nullable Not instance = null; protected Not() { @@ -119,7 +119,7 @@ public NotMap getNewInstance(Map arg, List pathToItem, PathToSchem } @Override - public NotMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public NotMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); @@ -140,7 +140,7 @@ public NotMap validate(Map arg, SchemaConfiguration configuratio } - public static class NotMoreComplexSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class NotMoreComplexSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -304,7 +304,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index 6e543475581..7167aa2d44e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -53,7 +53,7 @@ protected ObjectPropertiesValidationMap(FrozenMap<@Nullable Object> m) { "foo", "bar" ); - public static ObjectPropertiesValidationMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static ObjectPropertiesValidationMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return ObjectPropertiesValidation1.getInstance().validate(arg, configuration); } @@ -88,7 +88,7 @@ public static class ObjectPropertiesValidationMapInput { } - public static class ObjectPropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class ObjectPropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, ObjectPropertiesValidationMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -255,7 +255,7 @@ public ObjectPropertiesValidationMap getNewInstance(Map arg, List } @Override - public ObjectPropertiesValidationMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public ObjectPropertiesValidationMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index 1e207a768cc..be5af91a643 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -39,7 +39,7 @@ public class Oneof { public static class Schema0 extends IntJsonSchema {} - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -197,7 +197,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -229,7 +229,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class Oneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Oneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -396,7 +396,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index f3886edba3c..30eaee8d662 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -49,7 +49,7 @@ protected Schema0Map(FrozenMap<@Nullable Object> m) { "bar" ); public static final Set optionalKeys = Set.of(); - public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema0.getInstance().validate(arg, configuration); } @@ -72,7 +72,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema0Map> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -235,7 +235,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -278,7 +278,7 @@ protected Schema1Map(FrozenMap<@Nullable Object> m) { "foo" ); public static final Set optionalKeys = Set.of(); - public static Schema1Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema1Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema1.getInstance().validate(arg, configuration); } @@ -301,7 +301,7 @@ public static class Schema1MapInput { } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema1Map> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -464,7 +464,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema1Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema1Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -496,7 +496,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -663,7 +663,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index 4b41e545019..7e571ae0cb1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -35,7 +35,7 @@ public class OneofWithBaseSchema { // nest classes so all schemas and input/output classes can be public - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -193,7 +193,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -225,7 +225,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -383,7 +383,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 66559e81fc6..eb31dbd7e59 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -43,7 +43,7 @@ public static class Schema0 extends NumberJsonSchema {} public static class Schema1 extends AnyTypeJsonSchema {} - public static class OneofWithEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class OneofWithEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -210,7 +210,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 6403f108cd4..c2c71d07ca3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -44,7 +44,7 @@ protected Schema0Map(FrozenMap<@Nullable Object> m) { "foo" ); public static final Set optionalKeys = Set.of(); - public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema0Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema0.getInstance().validate(arg, configuration); } @@ -67,7 +67,7 @@ public static class Schema0MapInput { } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema0Map> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -228,7 +228,7 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema0Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -269,7 +269,7 @@ protected Schema1Map(FrozenMap<@Nullable Object> m) { "foo" ); public static final Set optionalKeys = Set.of(); - public static Schema1Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static Schema1Map of(Map arg, SchemaConfiguration configuration) throws ValidationException { return Schema1.getInstance().validate(arg, configuration); } @@ -292,7 +292,7 @@ public static class Schema1MapInput { } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, Schema1Map> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -453,7 +453,7 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS } @Override - public Schema1Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public Schema1Map validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); @@ -485,7 +485,7 @@ public Schema1Map validate(Map arg, SchemaConfiguration configur } } - public static class OneofWithRequired1 extends JsonSchema implements MapSchemaValidator> { + public static class OneofWithRequired1 extends JsonSchema implements MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -538,7 +538,7 @@ public static OneofWithRequired1 getInstance() { } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index f0a65822396..954c7857375 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -36,7 +36,7 @@ public class PatternIsNotAnchored { // nest classes so all schemas and input/output classes can be public - public static class PatternIsNotAnchored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class PatternIsNotAnchored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -202,7 +202,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index 1cd57f3217c..52cded92e58 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -36,7 +36,7 @@ public class PatternValidation { // nest classes so all schemas and input/output classes can be public - public static class PatternValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class PatternValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -202,7 +202,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index b0673f0d47a..d99673b9a30 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -68,7 +68,7 @@ protected PropertiesWithEscapedCharactersMap(FrozenMap<@Nullable Object> m) { "foo\tbar", "foo\fbar" ); - public static PropertiesWithEscapedCharactersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static PropertiesWithEscapedCharactersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return PropertiesWithEscapedCharacters1.getInstance().validate(arg, configuration); } @@ -83,7 +83,7 @@ public static class PropertiesWithEscapedCharactersMapInput { } - public static class PropertiesWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class PropertiesWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, PropertiesWithEscapedCharactersMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -254,7 +254,7 @@ public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public PropertiesWithEscapedCharactersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 20eba3a12bc..e405f9c53c0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -48,7 +48,7 @@ protected PropertyNamedRefThatIsNotAReferenceMap(FrozenMap<@Nullable Object> m) public static final Set optionalKeys = Set.of( "$ref" ); - public static PropertyNamedRefThatIsNotAReferenceMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static PropertyNamedRefThatIsNotAReferenceMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return PropertyNamedRefThatIsNotAReference1.getInstance().validate(arg, configuration); } @@ -63,7 +63,7 @@ public static class PropertyNamedRefThatIsNotAReferenceMapInput { } - public static class PropertyNamedRefThatIsNotAReference1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class PropertyNamedRefThatIsNotAReference1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, PropertyNamedRefThatIsNotAReferenceMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -229,7 +229,7 @@ public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List } @Override - public PropertyNamedRefThatIsNotAReferenceMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public PropertyNamedRefThatIsNotAReferenceMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 5ae740268eb..7ec239e49fe 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -32,7 +32,7 @@ protected RefInAdditionalpropertiesMap(FrozenMap<@Nullable Object> m) { } public static final Set requiredKeys = Set.of(); public static final Set optionalKeys = Set.of(); - public static RefInAdditionalpropertiesMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static RefInAdditionalpropertiesMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return RefInAdditionalproperties1.getInstance().validate(arg, configuration); } @@ -46,7 +46,7 @@ public static class RefInAdditionalpropertiesMapInput { } - public static class RefInAdditionalproperties1 extends JsonSchema implements MapSchemaValidator { + public static class RefInAdditionalproperties1 extends JsonSchema implements MapSchemaValidator<@Nullable Object, RefInAdditionalpropertiesMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -96,7 +96,7 @@ public RefInAdditionalpropertiesMap getNewInstance(Map arg, List p } @Override - public RefInAdditionalpropertiesMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public RefInAdditionalpropertiesMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index c628f2051ed..c4a36a525f2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -35,7 +35,7 @@ public class RefInAllof { // nest classes so all schemas and input/output classes can be public - public static class RefInAllof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInAllof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -201,7 +201,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index f73926e8f43..236552fbf70 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -35,7 +35,7 @@ public class RefInAnyof { // nest classes so all schemas and input/output classes can be public - public static class RefInAnyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInAnyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -201,7 +201,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java index 75282427268..ef6a6ef9127 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java @@ -28,17 +28,17 @@ public static class RefInItemsList extends FrozenList<@Nullable Object> { protected RefInItemsList(FrozenList<@Nullable Object> m) { super(m); } - public static RefInItemsList of(List arg, SchemaConfiguration configuration) throws ValidationException { + public static RefInItemsList of(List<@Nullable Object> arg, SchemaConfiguration configuration) throws ValidationException { return RefInItems1.getInstance().validate(arg, configuration); } } public static class RefInItemsListInput { - // class to build List + // class to build List<@Nullable Object> } - public static class RefInItems1 extends JsonSchema implements ListSchemaValidator { + public static class RefInItems1 extends JsonSchema implements ListSchemaValidator<@Nullable Object, RefInItemsList> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -85,7 +85,7 @@ public RefInItemsList getNewInstance(List arg, List pathToItem, PathT } @Override - public RefInItemsList validate(List arg, SchemaConfiguration configuration) throws ValidationException { + public RefInItemsList validate(List<@Nullable Object> arg, SchemaConfiguration configuration) throws ValidationException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); List castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index a4002580f49..b0000e068d0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -35,7 +35,7 @@ public class RefInNot { // nest classes so all schemas and input/output classes can be public - public static class RefInNot1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInNot1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index 577c2a9f882..5385f481ff8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -35,7 +35,7 @@ public class RefInOneof { // nest classes so all schemas and input/output classes can be public - public static class RefInOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class RefInOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -201,7 +201,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index 8059dade18c..879c02d7fbc 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -44,7 +44,7 @@ protected RefInPropertyMap(FrozenMap<@Nullable Object> m) { public static final Set optionalKeys = Set.of( "a" ); - public static RefInPropertyMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static RefInPropertyMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return RefInProperty1.getInstance().validate(arg, configuration); } @@ -69,7 +69,7 @@ public static class RefInPropertyMapInput { } - public static class RefInProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class RefInProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, RefInPropertyMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -235,7 +235,7 @@ public RefInPropertyMap getNewInstance(Map arg, List pathToItem, P } @Override - public RefInPropertyMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public RefInPropertyMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 0523cf9da88..c41cb3c672d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -48,7 +48,7 @@ protected RequiredDefaultValidationMap(FrozenMap<@Nullable Object> m) { public static final Set optionalKeys = Set.of( "foo" ); - public static RequiredDefaultValidationMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static RequiredDefaultValidationMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return RequiredDefaultValidation1.getInstance().validate(arg, configuration); } @@ -69,7 +69,7 @@ public static class RequiredDefaultValidationMapInput { } - public static class RequiredDefaultValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class RequiredDefaultValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, RequiredDefaultValidationMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -235,7 +235,7 @@ public RequiredDefaultValidationMap getNewInstance(Map arg, List p } @Override - public RequiredDefaultValidationMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public RequiredDefaultValidationMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index 1c2ed6a88d8..584bc53d8dd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -53,7 +53,7 @@ protected RequiredValidationMap(FrozenMap<@Nullable Object> m) { public static final Set optionalKeys = Set.of( "bar" ); - public static RequiredValidationMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static RequiredValidationMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return RequiredValidation1.getInstance().validate(arg, configuration); } @@ -78,7 +78,7 @@ public static class RequiredValidationMapInput { } - public static class RequiredValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class RequiredValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, RequiredValidationMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -248,7 +248,7 @@ public RequiredValidationMap getNewInstance(Map arg, List pathToIt } @Override - public RequiredValidationMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public RequiredValidationMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index b8cd82a726b..e0bd68bdcec 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -48,7 +48,7 @@ protected RequiredWithEmptyArrayMap(FrozenMap<@Nullable Object> m) { public static final Set optionalKeys = Set.of( "foo" ); - public static RequiredWithEmptyArrayMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static RequiredWithEmptyArrayMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return RequiredWithEmptyArray1.getInstance().validate(arg, configuration); } @@ -69,7 +69,7 @@ public static class RequiredWithEmptyArrayMapInput { } - public static class RequiredWithEmptyArray1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class RequiredWithEmptyArray1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, RequiredWithEmptyArrayMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -235,7 +235,7 @@ public RequiredWithEmptyArrayMap getNewInstance(Map arg, List path } @Override - public RequiredWithEmptyArrayMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public RequiredWithEmptyArrayMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index e3132b57ed4..3db2129194c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -48,7 +48,7 @@ protected RequiredWithEscapedCharactersMap(FrozenMap<@Nullable Object> m) { "foo\\bar" ); public static final Set optionalKeys = Set.of(); - public static RequiredWithEscapedCharactersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static RequiredWithEscapedCharactersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return RequiredWithEscapedCharacters1.getInstance().validate(arg, configuration); } @@ -63,7 +63,7 @@ public static class RequiredWithEscapedCharactersMapInput { } - public static class RequiredWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator { + public static class RequiredWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, RequiredWithEscapedCharactersMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -234,7 +234,7 @@ public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public RequiredWithEscapedCharactersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 9f4c9c6ca30..88ca2446c85 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -93,7 +93,7 @@ protected TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap(FrozenMap< public static final Set optionalKeys = Set.of( "alpha" ); - public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { return TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1.getInstance().validate(arg, configuration); } @@ -118,7 +118,7 @@ public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMapI } - public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1 extends JsonSchema implements MapSchemaValidator { + public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1 extends JsonSchema implements MapSchemaValidator<@Nullable Object, TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -170,7 +170,7 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap getNewInstanc } @Override - public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = List.of("args[0"); Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index 9474f66024d..f39eea6a951 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -35,7 +35,7 @@ public class UniqueitemsFalseValidation { // nest classes so all schemas and input/output classes can be public - public static class UniqueitemsFalseValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UniqueitemsFalseValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index ff8835ee713..f80ee4705d4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -35,7 +35,7 @@ public class UniqueitemsValidation { // nest classes so all schemas and input/output classes can be public - public static class UniqueitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UniqueitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index 1868cda502c..110daefde83 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -35,7 +35,7 @@ public class UriFormat { // nest classes so all schemas and input/output classes can be public - public static class UriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index 8ad6032fe9d..8f86e0bcdf2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -35,7 +35,7 @@ public class UriReferenceFormat { // nest classes so all schemas and input/output classes can be public - public static class UriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index 705d9bbe19d..0fd1db648d4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -35,7 +35,7 @@ public class UriTemplateFormat { // nest classes so all schemas and input/output classes can be public - public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator>, MapSchemaValidator> { + public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<@Nullable Object, FrozenList<@Nullable Object>>, MapSchemaValidator<@Nullable Object, FrozenMap<@Nullable Object>> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid } @Override - public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + public FrozenMap<@Nullable Object> validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { Set> pathSet = new HashSet<>(); List pathToItem = new ArrayList<>(); pathToItem.add("args[0]"); diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs index 097fce519b6..7ed1c36241c 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs @@ -1,9 +1,9 @@ {{#if types}} -public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements {{#each types}}{{#eq this "null"}}NullSchemaValidator{{else}}{{#eq this "boolean"}}BooleanSchemaValidator{{else}}{{#or (eq this "number") (eq this "integer")}}NumberSchemaValidator{{else}}{{#eq this "string"}}StringSchemaValidator{{else}}{{#eq this "array"}}ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<@Nullable Object>{{/if}}>{{else}}{{#eq this "object"}}MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}>{{/eq}}{{/eq}}{{/eq}}{{/or}}{{/eq}}{{/eq}}{{#unless @last}}, {{/unless}}{{/each}} { +public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements {{#each types}}{{#eq this "null"}}NullSchemaValidator{{else}}{{#eq this "boolean"}}BooleanSchemaValidator{{else}}{{#or (eq this "number") (eq this "integer")}}NumberSchemaValidator{{else}}{{#eq this "string"}}StringSchemaValidator{{else}}{{#eq this "array"}}ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<@Nullable Object>{{/if}}>{{else}}{{#eq this "object"}}MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}>{{/eq}}{{/eq}}{{/eq}}{{/or}}{{/eq}}{{/eq}}{{#unless @last}}, {{/unless}}{{/each}} { {{else}} -public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<@Nullable Object>{{/if}}>, MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}> { +public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator<{{#with items}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}, {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.camelCase}}{{else}}FrozenList<@Nullable Object>{{/if}}>, MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}> { {{/if}} {{#if componentModule}} /* diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs index b466a06e17e..2db5d9e6295 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs @@ -1,6 +1,6 @@ -public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}> { +public static class {{jsonPathPiece.camelCase}} extends JsonSchema implements MapSchemaValidator<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_input_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}, {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.camelCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}> { {{#if componentModule}} /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_cast_type_base.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_cast_type_base.hbs deleted file mode 100644 index 97d38dcc03d..00000000000 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_cast_type_base.hbs +++ /dev/null @@ -1,206 +0,0 @@ -{{#if types}} - {{#eq types.size 1}} - {{#each types}} - {{#eq this "boolean"}} - {{#if forceNull}} -Boolean - {{~else}} -boolean - {{~/if}} - {{else}} - {{#eq this "null"}} -Void - {{~else}} - {{#eq this "string"}} - {{#eq format "binary"}} -{{! todo binary types}} -String - {{~else}} -String - {{~/eq}} - {{else}} - {{#eq this "number"}} - {{#eq ../format null}} -Number - {{~else}} - {{#eq ../format "float"}} - {{#if forceNull}} -Float - {{~else}} -float - {{~/if}} - {{else}} - {{#eq ../format "double"}} - {{#if forceNull}} -Double - {{~else}} -double - {{~/if}} - {{else}} - {{#eq ../format "int32"}} - {{#if forceNull}} -Integer - {{~else}} -int - {{~/if}} - {{else}} - {{#eq ../format "int64"}} - {{#if forceNull}} -Long - {{~else}} -long - {{~/if}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{else}} - {{#eq this "integer"}} - {{#eq ../format null}} - {{#if forceNull}} -Long - {{~else}} -long - {{~/if}} - {{else}} - {{#eq ../format "int32"}} - {{#if forceNull}} -Integer - {{~else}} -int - {{~/if}} - {{else}} - {{#eq ../format "int64"}} - {{#if forceNull}} -Long - {{~else}} -long - {{~/if}} - {{/eq}} - {{/eq}} - {{/eq}} - {{else}} - {{#eq this "array"}} - {{#eq ../jsonPath sourceJsonPath}} -FrozenList - {{~else}} - {{#with items}} -FrozenList<{{> src/main/java/packagename/components/schemas/types/schema_cast_type }}> - {{~else}} -FrozenList - {{~/with}} - {{/eq}} - {{else}} - {{#eq this "object"}} - {{#eq ../jsonPath sourceJsonPath}} -FrozenMap - {{~else}} - {{#with mapValueSchema}} -FrozenMap<{{> src/main/java/packagename/components/schemas/types/schema_cast_type }}> - {{~else}} -FrozenMap - {{~/with}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/each}} - {{else}} - {{#eq types.size 2}} - {{#contains types "null"}} - {{! nullable types }} - {{#each types}} - {{#eq this "boolean"}} -Boolean - {{~else}} - {{#eq this "string"}} - {{#eq format "binary"}} -{{! todo binary types}} -String - {{~else}} -String - {{~/eq}} - {{else}} - {{#eq this "number"}} - {{#eq ../format null}} -Number - {{~else}} - {{#eq ../format "float"}} -Float - {{~else}} - {{#eq ../format "double"}} -Double - {{~else}} - {{#eq ../format "int32"}} -Integer - {{~else}} - {{#eq ../format "int64"}} -Long - {{~/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{else}} - {{#eq this "integer"}} - {{#eq ../format null}} -Long - {{~else}} - {{#eq ../format "int32"}} -Integer - {{~else}} - {{#eq ../format "int64"}} -Long - {{~/eq}} - {{/eq}} - {{/eq}} - {{else}} - {{#eq this "array"}} - {{#eq ../jsonPath sourceJsonPath}} -FrozenList - {{~else}} - {{#with items}} -FrozenList<{{> src/main/java/packagename/components/schemas/types/schema_cast_type }}> - {{~else}} -FrozenList - {{~/with}} - {{/eq}} - {{else}} - {{#eq this "object"}} - {{#eq ../jsonPath sourceJsonPath}} -FrozenMap - {{~else}} - {{#with mapValueSchema}} -FrozenMap<{{> src/main/java/packagename/components/schemas/types/schema_cast_type }}> - {{~else}} -FrozenMap - {{~/with}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/each}} - {{else}} - {{! none of the types are null }} - {{#and (contains types "integer") (contains types "number") }} -Number - {{~else}} -Object - {{~/and}} - {{/contains}} - {{else}} - {{! 3 or more types }} -Object - {{~/eq}} - {{/eq}} -{{else}} -Object -{{~/if}} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_input_type_base.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_input_type_base.hbs index f4a1d05d1bc..5128c83d4d4 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_input_type_base.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/types/_schema_input_type_base.hbs @@ -88,7 +88,7 @@ List {{#with items}} List<{{> src/main/java/packagename/components/schemas/types/schema_input_type }}> {{~else}} -List +List<@Nullable Object> {{~/with}} {{/eq}} {{else}} @@ -99,7 +99,7 @@ Map {{#with mapValueSchema}} Map src/main/java/packagename/components/schemas/types/schema_input_type }}> {{~else}} -Map +Map {{~/with}} {{/eq}} {{/eq}} @@ -116,31 +116,31 @@ Map {{! nullable types }} {{#each types}} {{#eq this "boolean"}} -Boolean +@Nullable Boolean {{~else}} {{#eq this "string"}} {{#eq format "binary"}} {{! todo binary types}} -String +@Nullable String {{~else}} -String +@Nullable String {{~/eq}} {{else}} {{#eq this "number"}} {{#eq ../format null}} -Number +@Nullable Number {{~else}} {{#eq ../format "float"}} -Float +@Nullable Float {{~else}} {{#eq ../format "double"}} -Double +@Nullable Double {{~else}} {{#eq ../format "int32"}} -Integer +@Nullable Integer {{~else}} {{#eq ../format "int64"}} -Long +@Nullable Long {{~/eq}} {{/eq}} {{/eq}} @@ -149,36 +149,36 @@ Long {{else}} {{#eq this "integer"}} {{#eq ../format null}} -Long +@Nullable Long {{~else}} {{#eq ../format "int32"}} -Integer +@Nullable Integer {{~else}} {{#eq ../format "int64"}} -Long +@Nullable Long {{~/eq}} {{/eq}} {{/eq}} {{else}} {{#eq this "array"}} {{#eq ../jsonPath sourceJsonPath}} -List +@Nullable List {{~else}} {{#with items}} -List<{{> src/main/java/packagename/components/schemas/types/schema_input_type }}> +@Nullable List<{{> src/main/java/packagename/components/schemas/types/schema_input_type }}> {{~else}} -List +@Nullable List<@Nullable Object> {{~/with}} {{/eq}} {{else}} {{#eq this "object"}} {{#eq ../jsonPath sourceJsonPath}} -Map +@Nullable Map {{~else}} {{#with mapValueSchema}} -Map src/main/java/packagename/components/schemas/types/schema_input_type }}> +@Nullable Map src/main/java/packagename/components/schemas/types/schema_input_type }}> {{~else}} -Map +@Nullable Map {{~/with}} {{/eq}} {{/eq}} @@ -198,9 +198,13 @@ Object {{/contains}} {{else}} {{! 3 or more types }} + {{#contains types "null"}} +@Nullable Object + {{else}} Object + {{/contains}} {{~/eq}} {{/eq}} {{else}} -Object +@Nullable Object {{~/if}} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/types/schema_cast_type.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/types/schema_cast_type.hbs deleted file mode 100644 index 7b949d47d08..00000000000 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/types/schema_cast_type.hbs +++ /dev/null @@ -1,13 +0,0 @@ -{{#if refInfo}} - {{#if refInfo.refModule}} - {{#with getDeepestRef}} -{{> src/main/java/packagename/components/schemas/types/_schema_cast_type_base }} - {{/with}} - {{else}} - {{#with refInfo.ref}} -{{> src/main/java/packagename/components/schemas/types/_schema_cast_type_base }} - {{/with}} - {{/if}} -{{else}} -{{> src/main/java/packagename/components/schemas/types/_schema_cast_type_base }} -{{/if}} \ No newline at end of file